November 2016
Beginner to intermediate
959 pages
43h 46m
English
The lattice package produces Trellis plots to capture multivariate relationships in the data. Lattice plots are useful for looking at complex relationships between variables in a dataset. For example, we may want to see how y changes with x across various levels of z. Using the lattice package, we can draw histograms, boxplots, scatterplots, dot plots and so on. Both plotting and annotation are done in one single call.
Download the files for this chapter and store the auto-mpg.csv file in your R working directory. Read the file using the read.csv function and save in the auto variable. Convert cylinders into a factor variable:
> auto <- read.csv("auto-mpg.csv", stringsAsFactors=FALSE) > cyl.factor ...Read now
Unlock full access