Installing R on Your Personal Computer

R is a general purpose statistical and data management package.

R is already installed on Winstat, on the SSCC Linux servers and in the SSCC computer labs. But since R is open-source, you are free to download, install, and use R on your computer as well.

If you would like to set up your personal computer to be similar to your SSCC working environment, you will need to download and install several software components.

  • R (the core software)
  • RStudio (the user interface)
  • TeXLive (a LaTeX installation)
  • RTools (to compile R packages from source code on Windows computers)

Windows

  • Go to the R for Windows download page, then click Download R #.#.# for Windows], where #.#.# will be the current version number. When the download is complete, double-click on the file to start the installation. (You will need administrator privileges on your computer.)

  • Next go to the RStudio download page, click on the Download button under RStudio Desktop. Again, when the download is complete, install by double-clicking on the file.

  • If you will be using R to knit or weave documents, go to the TeXLive installation page. Here again, you will need to pay attention to administrator privileges. If you are not knitting or weaving documents, you can skip this step for now.

  • Finally, if you will be using R packages that require compilation or that use a compiler, go to the RTools installation page. Be sure to follow all the instructions, including creating environment variables!

Mac

  • Go to the R for Mac OS X download page, then click on R-#.#.#.dmg where #.#.# will be the version number of the current version. When that file has finished downloading, double-click on it to start the installation.

  • Next go to the RStudio download page, click on the Download button under RStudio Desktop. Again, when the download is complete, install by double-clicking on the file.

  • If you will be using R to knit or weave documents, go to the TeXLive installation page. If you are not knitting or weaving documents, you can skip this step for now.

  • Tools for compiling R source are already installed on Macs.

Packages

If your computer is always connected to the SSCC network, you may want to store your packages on your U: drive. Then if you ever want to run R on Winstat or in the SSCC computer labs your packages will already be installed. See Using R Packages on SSCC Computers for instructions.

Updating R

You should periodically update R and all your packages to their latest versions to take advantage of new functionalities and maintain compatibility. Around four updates to R are released every year, where one of these is a “major” update. To update R, uninstall it and then install the latest version as described above.

You’ll need to move your packages from the old version’s folder to the new version’s. (You can find where your packages are installed on your computer by running .libPaths().) Once you have done this you can run

update.packages()

Last Revised: 10/25/2021