library(tidyverse)
library(ggtext)
library(janitor)
library(flextable)
library(patchwork)

buffer <- readRDS("./buffer.rds")
codebook <- readRDS("./codebook.rds")

My objective is to learn how the struggles with remote work differ among workers. “Not being able to unplug” is the largest reported struggle. “Difficulties with collaboration and communication” is second, followed by “Loneliness”, “Distractions at home”, and “Staying motivated”. “Being in a different timezone than teammates” was least reported struggle.

buffer %>%
  count(struggle) %>%
  mutate(pct = n / sum(n),
         struggle = fct_reorder(struggle, pct),
         struggle = fct_relevel(struggle, "Other", after = 0)) %>%
  ggplot(aes(x = struggle, y = n)) +
  geom_col(fill = "lightsteelblue", color = "steelblue") +
  geom_text(aes(label = scales::percent(pct, accuracy = 1)), 
            size = 3, nudge_y = -20, color = "#333333") +
  coord_flip() +
  theme_light() +
  labs(x = NULL, y = NULL,
       title = "Unplugging is top struggle with remote work.",
       subtitle = codebook %>% filter(item == "struggle") %>% pull(desc),
       caption = "Source: buffer.com/2021-state-of-remote-work.")

plot_prop <- function(x, grp_var, grp_title) {
  grp_var <- ensym(grp_var)
  x %>%
    filter(struggle != "Other") %>%
    count(struggle, !!grp_var) %>%
    group_by(!!grp_var) %>%
    mutate(pct = n / sum(n)) %>%
    ggplot(aes(x = fct_rev(!!grp_var), y = pct)) +
    geom_col(fill = "lightsteelblue", color = "steelblue") +
    geom_text(aes(label = n), size = 3, nudge_y = -.03) +
    scale_y_continuous(labels = scales::percent_format()) +
    coord_flip() +
    theme_light() +
    theme(strip.background = element_rect(fill = "gray90"),
          strip.text = element_text(color = "steelblue")) +
    labs(title = grp_title, 
         subtitle = codebook %>% filter(item == grp_var) %>% pull(desc),
         y = NULL, x = NULL, fill = NULL) +
    facet_wrap(facets = vars(struggle))
}

Preference for Remote Work

The overwhelming majority of all survey respondents prefer to indefinitely continue remote work, at least some of the time. It’s important to keep this in context because we are looking at the struggles among workers who overwhelming think they are worth the benefits.

p1 <- buffer %>%
  ggplot(aes(x = fct_rev(struggle), fill = prefer_remote)) +
  geom_bar(color = "gray70") +
  coord_flip() +
  theme_light() +
  scale_fill_manual(values = c("lightgoldenrod", "lightsteelblue")) +
  theme(legend.position = "top") +
  guides(fill = guide_legend(reverse=TRUE)) +
  labs(subtitle = codebook %>% filter(item == "prefer_remote") %>% pull(desc),
       y = NULL, x = NULL, fill = NULL) +
  theme(
    plot.subtitle = element_textbox_simple(
      size = 10,
      lineheight = 1,
      padding = margin(5.5, 5.5, 5.5, 5.5),
      margin = margin(0, 0, 5.5, 0),
      fill = "#FFFFFF"
    )
  )

p2 <- buffer %>%
  ggplot(aes(x = fct_rev(struggle), fill = recommend_remote)) +
  geom_bar(color = "gray70") +
  coord_flip() +
  theme_light() +
  scale_fill_manual(values = c("lightgoldenrod", "lightsteelblue")) +
  theme(legend.position = "top") +
  guides(fill = guide_legend(reverse=TRUE)) +
  labs(subtitle = codebook %>% filter(item == "recommend_remote") %>% pull(desc),
       y = NULL, x = NULL, fill = NULL) +
  theme(
    plot.subtitle = element_textbox_simple(
      size = 10,
      lineheight = 1,
      padding = margin(5.5, 5.5, 5.5, 5.5),
      margin = margin(0, 0, 5.5, 0),
      fill = "#FFFFFF"
    )
  )

p1 + p2 +
  plot_annotation(title = "Nearly everyone prefers and recommends remote work.",
                  caption = "Source: buffer.com/2021-state-of-remote-work.")

Race

All racial groups shared a common struggle with “Not being able to unplug”. Black and Asian were relatively more likely to cite “Distractions at home”. Multiracial workers were relatively more likely to cite “Loneliness”.

buffer %>% plot_prop("race", 
                     "Black and Asian struggle more with distractions.")

Work Experience

New workers (less then six months) were more likely to cite struggling with motivation. After six months, workers struggled a great deal with loneliness, but with diminishing rate as work experience increased. Struggling to unplug was positively associated with experience.

buffer %>% plot_prop("work_exp", 
                     "Work experience associated with unplugging, loneliness.")

Remote Work Experience

Experience with remote work followed a similar pattern to overall work experience, except that the relationship with loneliness disappears.

buffer %>% plot_prop("remote_exp", 
                     "Remote work experience less accociated with motivation struggles.")

Employment Type

Distractions were a bigger problem for business owners and the self-employed than for regular employees. Employees were relatively more likely to struggle with collaboration.

buffer %>% plot_prop("emp_type", 
                     "Distractions a bigger problem for business owners and the self-employed.")

Percent Remote

Organizations where more than half the employees are remote struggle more.

buffer %>% plot_prop("pct_remote", 
                     "Employees increasingly struggle to collaborate as remote work grows.")

COVID

Working remotely as a result of COVID was closely tied to collaboration issues, and inversely related to timezone issues.

buffer %>% plot_prop("covid", 
                     "Covid-induced remote work is related to collaboration issues.")

Disability

Having a disability or chronic illness had little effect on the types of struggles workers experience.

buffer %>% plot_prop("disability", 
                     "Disabilities and illness not related to remote work struggles.")

Caregivers

Parents and caregivers were much more likely to struggle with distractions. The upside is that they were also less likely to feel lonely.

buffer %>% plot_prop("caregiver", 
                     "Caregivers were more distracted, but less lonely.")

Full-time Employees

Smaller organizations struggle with distractions, motivation; bigger with unplugging

buffer %>% plot_prop("fte", 
                     "Smaller organizations struggle with distractions; bigger with unplugging.")

Industry

Struggles are farely common across industries. Government predictably does not deal with time zone issues.

buffer %>% plot_prop("industry", 
                     "Struggles span industries.")

Role

Struggles are farely common across job roles. Sales roles predictably do not deal with collaboration issues.

buffer %>% plot_prop("role", 
                     "Struggles span roles.")

Conclusions

What factors are likely to lead to each of the struggles? The table below shows the distribution of struggles for each group of each variable. Struggles that map strongly, which I define as >25% to any struggle are colored blue. Unfortunately, most factor levels map strongly only to Unplugging.

struggle_prop <- function(fctr) {
  fctr_var <- ensym(fctr)
  buffer %>% 
    filter(struggle != "Other") %>%
    count(Level = !!fctr_var, struggle) %>%
    group_by(Level) %>%
    mutate(Factor = fctr, pct = n / sum(n)) %>%
    pivot_wider(id_cols = c(Factor, Level), names_from = struggle, values_from = pct) %>%
    mutate(Level = as.character(Level))
}

smry_mtrx <- bind_rows(
  struggle_prop("race"),
  struggle_prop("work_exp"),
  struggle_prop("remote_exp"),
  struggle_prop("emp_type"),
  struggle_prop("pct_remote"),
  struggle_prop("covid"),
  struggle_prop("disability"),
  struggle_prop("caregiver"),
  struggle_prop("fte"),
  struggle_prop("industry"),
  struggle_prop("role")
) %>%
  pivot_longer(cols = Timezones:Motivation, names_to = "struggle") %>%
  mutate(color = if_else(value > 1/4, "dodgerblue", "darkgray"))

color_wide <- smry_mtrx %>% 
  pivot_wider(id_cols = c(Factor, Level), names_from = struggle, values_from = color) %>%
  as.matrix()

smry_mtrx %>%
  mutate(value = value * 100) %>%
  pivot_wider(id_cols = c(Factor, Level), names_from = struggle, values_from = value) %>%
  flextable::as_grouped_data(groups = "Factor") %>%
  flextable::flextable() %>%
  flextable::color(i = ~ is.na(Factor), j = 3:8, color = color_wide[, 3:8]) %>%
  flextable::bg(i = ~ !is.na(Factor), bg = "lightgray") %>%
  flextable::colformat_double(j = 3:8, digits = 0, suffix = "%") %>%
  flextable::border(j = 2, border.right = officer::fp_border(color = "lightgray")) %>%
  flextable::autofit() %>%
  flextable::bold(j = 1:2) %>%
  flextable::fontsize(size = 10) %>%
  flextable::autofit()