View Interactive Version
library(ggplot2) ggplot(___) + geom_point( mapping = aes(x = ___, y = ___) )
To create plots with ggplot2 you first need to load the package using
After the package has been loaded specify the dataset to be used as an argument of the
ggplot() function. For example, to specify a plot using the
cars dataset you can use:
Note that this command does not plot anything but a grey canvas yet. It just defines the dataset for the plot and creates an empty base on top of which we can add additional layers.