Exploratory Data Analysis in R
Andrew Bray
Assistant Professor, Reed College
email %>%
mutate(has_image = image 0) %>%
ggplot(aes(x = as.factor(has_image), fill = spam)) +
geom_bar(position = "fill")
email %>%
mutate(has_image = image 0) %>%
ggplot(aes(x = spam, fill = has_image)) +
geom_bar(position = "fill")
email <- email %>% mutate(zero = exclaim_mess == 0)
levels(email$zero)
NULL
email$zero <- factor(email$zero,
levels = c("TRUE", "FALSE"))
email %>%
ggplot(aes(x = zero)) +
geom_bar() +
facet_wrap(~spam)
email %>%
ggplot(aes(x = zero)) +
geom_bar() +
facet_wrap(~spam)
Exploratory Data Analysis in R