Installing Packages in R

Installing Packages in R in Console

R has a similar install and load method. If you wish to use a package in R, you can check if it's already installed by using the Package Manager. If it is listed, it is installed and need only be loaded with the check button and skip subsequent steps in this section. If not installed, follow steps 2 and 3 and then come back to the first step.

  1. To use, select the Package Manager the Packages & Data menu. This will bring up the R Package Manager window. Search for and check the button beside BiocManager to load.

    Installing%20Packages%20in%20R%20f9ff15999ad340c4abbfcbfa65b9ef52/manager.jpg

  2. Launch R (from the Applications Folder) and select Package Installer from the Packages & Data menu.

    Installing%20Packages%20in%20R%20f9ff15999ad340c4abbfcbfa65b9ef52/Screen_Shot_2020-06-11_at_9.58.53_AM.png

  3. Using graphic below to assist, Select CRAN (binaries), click Get List button and type biocmanager in the search box to limit the choices. Click on the BiocManger in the Package list. Select At System Level, check Install Dependancies and finally click the Install Selected button.

    Installing%20Packages%20in%20R%20f9ff15999ad340c4abbfcbfa65b9ef52/Package_installer.jpg

  4. You can also do all the installations of packages as described in the R Desktop version in the console window.

Running R in Terminal with Command-line

The difference between "running R in Terminal" and "R in Console" is that the Terminal app version is more minimalist. On the Mac, you can run R in the Terminal app by typing "R" at the command prompt (no quotes) OR by launching R from the Applications folder. You will get the window below when running R in the Terminal window.

Installing%20Packages%20in%20R%20f9ff15999ad340c4abbfcbfa65b9ef52/rterm.png

You can do all the installations of packages as described in Section 3 "R Desktop" version in the console window at the prompt >. One benefit is working with remote files with R remotely described below.