Exploratory Data Analysis in R
Andrew Bray
Assistant Professor, Reed College



Analyze the two components separately
Collapse into two-level categorical variable

email %>%
  mutate(zero = exclaim_mess == 0) %>%
  ggplot(aes(x = zero)) +
  geom_bar() +
  facet_wrap(~spam)

email %>%
  mutate(zero = exclaim_mess == 0) %>%
  ggplot(aes(x = zero, fill = spam)) +
  geom_bar()

email %>%
  mutate(zero = exclaim_mess == 0) %>%
  ggplot(aes(x = zero, fill = spam)) +
  geom_bar(position = "fill")

Exploratory Data Analysis in R