A.1 Installing a Package
The easiest way to install an R Package is to use the RStudio tab “Packages”:
Click on the “Packages” tab
Click on “Install” next to Update
Type the name of the package under “Packages, in this case type ggplot2
Click “Install”
This will search for the package “ggplot” specified on a server (the so-called CRAN website). If the package exists, it will be downloaded to a library folder on your computer. Here R can access the package in future R sessions without having to reinstall it.
An other way is to use the install.packages function. Open R (if already opened please close all projects) and type the following at the command line:
If you want to install a package directly from github, the package “devtools” must be installed first: