Installation instructions: R and RStudio
This course requires three installations:
- R is a statistical programming language
- RStudio is an integrated development environment (IDE) that allows you to code in R more easily
- Tidyverse is a collection of R packages (software tools) designed for analyzing data
Please make sure you install all three items listed above following instructions for your operating system for R and RStudio (R must be installed first), then opening RStudio to install Tidyverse.
RWindows
- Download the installer for the latest version of R from CRAN. The file will begin downloading automatically.
- Double-click the downloaded
.exe
file and follow the prompts to install. - Go to the RStudio download page.
- Under Installers, click the link for the Windows Vista/7/8/10 installer to download it.
- Double-click the downloaded
.exe
file and follow the prompts to install (default options are acceptable). - Once both are installed, launch RStudio and make sure there are no error messages, then proceed to install Tidyverse following the instructions below.
macOS
- Download the installer for the latest version of R compatible with your version of macOS from CRAN. If you are not using a recent version of macOS you may have to scroll down to Binaries for legacy OS X systems and find the one appropriate for your version of macOS. To check what version of macOS you are using, click the apple icon in the upper left corner of your screen and go to About This Mac. Please note the instructions on that page for downloading and installing XQuartz if necessary.
- Double-click the downloaded
.pkg
file and follow the prompts to install (default options are acceptable). - Go the the RStudio download page.
- Under Installers, click the link for the your OSX version’s installer to download it.
- Double-click the downloaded
.dmg
file, then open the RStudio folder that appears on your desktop. Drag the RStudio icon into the Applications folder. - Once both are installed, launch RStudio and make sure there are no error messages, then proceed to install Tidyverse following the instructions below.
Tidyverse
Tidyverse is a collection of packages containing additional software we’ll be using in this workshop. A few notes about package installation:
- You only need to perform this installation once per computer, or when updating R or the package.
- If you see red text output in the Console during this installation, don’t be alarmed: this doesn’t necessarily indicate a problem. You are seeing a report of the various pieces of software being downloaded and installed.
- If prompted, you should install all packages (say yes or all), as well as yes to compiling any packages
You have two options for installing Tidyverse using RStudio:
Packages tab
- Click the Packages tab in the lower right panel.
- Click the Install button (upper left corner of the panel). In the empty space for Packages, type
tidyverse
. The other defaults (Install from CRAN and the Install to Library path) should be ok. Make sure the box next to “Install dependencies” is checked, and click Install. - If your installation is successful, you should see tidyverse appear in the list below the Install button.
Console
- Click in the Console (left panel with a right-facing arrow,
>
, ready to accept commands). - Type
install.packages("tidyverse")
and hit Enter - When the installation is complete (this may take several minutes),
you’ll see the command prompt (
>
) appear again at the bottom of your Console.