September 2018
Beginner
206 pages
4h 27m
English
The following code is used to recreate the various plots using the mpg and diamonds datasets:
ggplot(mpg, aes(class)) + geom_bar(fill = "purple")ggplot(mpg, aes(class, fill = as.factor(drv))) + geom_bar(position = "fill")#scatter plotggplot(diamonds, aes(carat, price, col = cut)) + geom_point(alpha = 0.4)ggplot(diamonds, aes(carat, price)) + geom_point(shape = 6, alpha = 0.3)
Read now
Unlock full access