A ———————————————————————–

ggplot(mpg, aes(x=manufacturer)) + 
  geom_bar(stat="count") + theme(axis.text.x = element_text(angle = 90))

B ———————————————————————–

ggplot(mpg, aes(x=year)) +
  geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

C ———————————————————————–

ggplot(mpg, aes(x=displ, color=as.character(cyl))) +
  geom_density() + labs(title="Density Plot", subtitle="Displ by Cyl",
                        x="Displ", y="Density", color="# of Cyl") +
  theme(plot.background = element_rect(fill="gray"))

ggplot(mpg, aes(x=cty, color=as.character(cyl))) +
  geom_density() + labs(title="Density Plot", subtitle="City Mileage by Cylinder",
                        x="City Mileage", y="Density", color="# of Cyl")+ 
  theme(plot.background = element_rect(fill="gray"))

ggplot(mpg, aes(x=hwy, color=as.character(cyl))) +
  geom_density() + labs(title="Density Plot", subtitle="Highway Mileage by Cylinder",
                        x="Highway Mileage", y="Density", color="# of Cyl") + 
  theme(plot.background = element_rect(fill="gray"))

D ———————————————————————–

ggplot(mpg, aes(y = displ, x = as.factor(cyl), fill=as.factor(cyl))) +
  geom_boxplot() + labs(title="Box Plot - Displ by Cylinder", x="Cylinder",
                        y="Displ") + theme(plot.background = element_rect(fill="gray"), legend.position = "none")