There are three ways to install an R package. The first way is to use the install.packages() function. For example, assume that we plan to install an R package called rattle. We can use the following code to do this:
>install.packages("rattle")
The second way is to click Packages on the menu bar, choose a mirror location, then find the R package from a list (see the following screenshot showing the top part of the list):
The third way to install an R package is to install it from a local ZIP file. To do so, first, manually download a ZIP file to your computer. Then click Packages on the menu bar and choose Install ...