In this session we will use an R package called ggplot2
to provide us with easiers ways to create complex plots. But first we have to learn how to download the packages which can be done using install.packages()
and library()
or we can use RStudio to download them.
Using install.packages()
and library()
:
#install package
install.packages("ggplot2")
#Once package is installed to actually use it you need to load it
library("ggplot2")
Or we can use RStudio to manually install the packages. In the bottom right corner of RStudio click the Packages tab and then the install icon.
Type in ggplot2
To load click the check box next to ggplot2