Lecture 2.2 - Basic Graphics with ggplot2

The package gets its name from leland wilkinsons

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 different 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 fine, 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

Ask a homework question - tutors are online