Unformatted text preview: ts
name from Leland Wilkinson’s grammar graphics which provides a formal,
structured perspective on how to describe data graphics.
ggplot2 takes a diﬀerent approach to graphics than other graphing
packages in R.
There are two major functions that you will use in ggplot2
qplot() - for quick plots
ggplot() - for ﬁne, granular control of everything (not going to get
into this in this post)
Basic Intro to ggplot2:
http://www.r-bloggers.com/basic-introduction-to-ggplot2/ Documentation for ggplot2 http://docs.ggplot2.org/current/ Dai-Trang Le Lecture 2.2 - Basic Graphics with ggplot2 Graphics with ggplot2 (25 minutes)
Group Discussion (15 minutes)
Q and A (10 minutes)
Writing Loading Data Function qplot()
Basic Histogram and bar plot (1 variable)
plot1 = qplot(rating, data=movies, geom="histogram", binwidth = .5,
colour = "blue")
Basic Scatterplot (2 continuous variables)
plot2 = qplot(data=mtcars, x = hp, y = mpg, color...
View Full Document
- Fall '13
- Slash, Delimiter-separated values, ggplot2, loading data, Dai-Trang Le