The following data show commuting transportation methods for states on the West Coast of the United States.
library(tidyverse)
#rds is an special r dataframe
commute <- readRDS("~/Desktop/DataViz Reading/Week 5 Data and Code/commute.rds")
# a subset of states for class
states <- c("or", "ak", "ca", "wa", "id", "nv")
commute_nw <- filter(commute, state %in% states)
Pie charts are common, but not great for:
ggplot(commute_nw) +
geom_bar(aes(x = "", y = prop, fill = factor(transport_type)),
stat = "identity", width = 1) +
facet_wrap(~ state_name) +
coord_polar(theta = "y") +
theme_minimal(18) +
xlab("") + ylab("") +
theme(axis.text = element_blank())+
scale_fill_discrete(name = "Transporation")+
labs(title="People in Oregon commute by bicycle more \nthan in other (nearby) states")