There are three key plotting systems in R, the Base, which is a type of artist’s palette, model, a Lattice System, which allows to specify an entire plot specified by one function and the conditioning ggplot2 with mixed elements of Base and Lattice.

Plotting in R:

library(datasets)
data(cars)
with(cars, plot(speed, dist))

Lattice Plot

library(lattice)
state <- data.frame(state.x77, region = state.region)
xyplot(Life.Exp ~ Income | region, data = state, layout = c(4, 1))

The ggplot2 System

library(ggplot2)
data(mpg)
qplot(displ, hwy, data = mpg)

#by Linda, September 2020