교육용 프로그래밍의 이해
2020-09-26
Chapter 1 Problem 1
Using the mpg dataset in the ggplot2 packages. replicate the plot below using the following settings
- Set alha = 0.5 for the width of bars
- Use theme_minimal()
library(ggplot2)
ggplot(mpg, aes(hwy)) +
geom_bar(aes(fill = drv), alpha = 0.5, width = 1) +
labs(
title = "Histogram",
subtitle = "Histogram of Highway Mile Per Gallon",
caption = "Source: mpg"
) +
theme_minimal()