Lecture 2.2 - Basic Graphics with ggplot2

Factorcyl geom point main plot 2 boxplot 1 categorical

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: = as.factor(cyl), geom = "point", main = "Plot 2") Boxplot (1 categorical var and 1 continous var) plot3 = qplot(data = mtcars, x = as.factor(carb), y = mpg, geom = "boxplot", main = "Plot 3", xlab = "Number of carburetors")) 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 Adding Multiple Plots To arrange multiple ggplot2 plots in the same image window, you need to download the package gridExtra. Example: library(gridExtra) grid.arrange(plot1, plot2, plot3, ncol = 3) 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 ggplot() 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 Group Discussion Get together with your group member to work on your project Each group...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online