Software installation

The information in this module follows on the pre-class video on setting up R and RStudio on your computer.

Installing R on your computer

As of August 2023, the most up-to-date version of R is 4.3.1. The R Project for Statistical Computing are continually working to update and improve R, and as a result there are new versions 1-2 times per year.

If you already have R installed, you can open the console and check your current version by typing (or copy/pasting) this: R.Version()$version.string

If you do not have R, or have an older version than that listed above, you can install or update R by going to the R repository: https://www.r-project.org/. Note that there are many ‘mirrors’ or servers where the software is stored. Generally it is wise to select one that is geographically close to you, although any should work in theory. One mirror that is relatively close to Atlanta is here: http://archive.linux.duke.edu/cran/

0.0.1 R installation notes for Mac OS users

If you click on Mac OS from the cran webpage, you will see several different options for installation. Specifically, there is a versions for Mac with Intel processors, and a different version for Mac OS with Apple Silicon (e.g. M1 chip).

How do I know what chip is in my Mac?

If you do not know whether you have Intel or Apple processors, click on the Apple icon and choose “About this Mac”. In the resulting window look for either of these:

  • Chip Apple M1 Pro means that you have Apple Silicon. You should download that has arm64 in the name. The description will say it is for native Apple silicon.
  • Processor xxx where xxx is an Intel chip. This means you have the older Intel chip, and you should download the R installer that is for Intel-based Macs.

0.0.1.1 Installing Xcode (Mac only)

There are some packages that require compiling done outside of R. You may need the utility package Xcode to do this. This is not an R package, but instead an app available from the Apple Store. Open the Apple Store, search for Xcode and install.

Xcode is BIG! If you don’t have much storage on your hard drive this might be a problem. You have two options:

  1. Don’t install Xcode and see what happens. Depending on other configurations on your machine, it might not be necessary. You will know there is a problem if some packages do not install.
  2. Try install a “slimmer” version of Xcode by following these instructions.

0.0.2 R installation for Windows OS users

If you are using a computer running Microsoft Windows OS, you will click on the Windows option on the CRAN website. Choose the option that reads base and click on the most recent downloader.

0.0.2.1 Installing Rtools43 (Windows Only)

While most of your work with R packages (e.g. installing new ones) can be done with the base-R tools, there are instances where an installation of a new package requires a more complex ‘unpacking’ of the code or installation from github. Windows machine may require additional tools to do this work. Luckily there is a package for that! It is called Rtools43 (assuming you have already downloaded and installed R 4.2), and you should install that before you install the packages below.

Note that Rtools43 is not a package within R, but instead is a Windows utility installed outside of R itself.

If you are running Windows, navigate back to the CRAN website, choose Windows, and then – instead of clicking on base – click on Rtools and follow the instructions. Specifically, be sure your version of Rtool aligns with your version of R. For example, if you have R 4.3.1, then choose Rtools43.

Installing RStudio on your computer

R-Studio is one of several integrated development environments (IDE) for working in R. That means it is a wrapper around the core R functionality that makes coding and project work in R much easier than it would be without. We develop projects or analyses using R within an IDE such as R-Studio. Using R-Studio lets us have robust code-editing and debugging, code syntax highlighting (e.g. coloring different words according to their use, and identifying possible errors), and some assistance with file management, working in larger projects, and outputting results.

The current version of RStudio 2023.06.1+524. If you do not have RStudio or have an up-to-date version, please install or update it.

TO INSTALL: go to https://posit.co/download/rstudio-desktop/

TO UPDATE: Open RStudio and go to Help Menu and choose ‘Check for Updates’

R-Studio Cheat sheet provides a quick reference guide for many of the ways that R-Studio makes your work with R easier.

In fact, there are “cheat sheets” for lots of packages and utilities in R; browse some of them here.