qplot
# General command
qplot(x, y, data=, color=, shape=, size=, alpha=, geom=, method=, formula=, facets=, xlim=, ylim= xlab=, ylab=, main=, sub=)
# Barplot - one set of data
qplot(mpg, data=mtcars)
# Scatterplot - two sets of data
qplot(hp, mpg, data=mtcars)
# Multiple geometries
qplot(wt, mpg, data=mtcars, geom=c("point", "smooth"))
# Adding other information
ggplot
# scatterplot
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
ggplot(diamonds, aes(x = carat, y = price))+geom_point()
# smooth
ggplot(diamonds, aes(x = carat, y = price))+geom_point() + geom_smooth()
# line
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
References
http://www.statmethods.net/advgraphs/ggplot2.html
http://zevross.com/blog/2014/08/04/beautiful-plotting-in-r-a-ggplot2-cheatsheet-3/
http://tutorials.iq.harvard.edu/R/Rgraphics/Rgraphics.html
https://opr.princeton.edu/workshops/Downloads/2015Jan_ggplot2Koffman.pdf