In this chapter, we will walk you through the process of installing R and the desktop version of RStudio. Although you will need to install both R and RStudio, once they are installed you will only interact with RStudio when you compute.
To install R, navigate your web browser to:
Then,
CRAN
link under Download
on the left-hand side of the page.Iowa State University
link under USA
.2Download and Install R
box, choose the binary that matches the operating system (OS) for your computer.This is where the installation directions diverge depending on your OS.
Mac Instructions
So long as you are running MacOS 10.13 or higher just click the first link for the PKG, which will download the installer for the most current version of R (4.1.1 as of August 16, 2021). Once the download completes, open the installer and follow the directions to install R on your computer.
If you are running an older version of MacOS, you will have to install an older version of R. You can find these links under the Binaries for legacy OS X systems
heading further down the install page. Click the appropriate PKG link for R your version of MacOS. Once the download completes, open the installer and follow the directions to install R on your computer.
If you are unsure which version of the MacOS is running on your computer, select About this Mac
from the Apple menu in your toolbar.
Windows Instructions
Click the link that says Install R for the first time
(or click base
; they go to the same place). Then click the Download R 4.1.1 for Windows
link, which will download the installer for the most current version of R (4.0.2 as of July 24, 2020). Once the download completes, open the installer and follow the directions to install R on your computer.
Linux Instructions
If you are running Linux, you should know how to install things on your computer. 😀
After you have installed R, you next need to install RStudio Desktop. To do this, navigate your web browser to:
https://rstudio.com/products/rstudio/download/
Then,
Download
button under the free, open-source version of RStudio Desktop.From your Applications or Programs folder, open RStudio. If you have successfully downloaded both programs, this should open the application and you should see a message indicating that you are using “R version 4.1.1” (or whichever version of R you installed) in the console pane.
While the information in this section is not crucial for making things work, it is useful to get RStudio looking good and setting some default settings. Open the Tools > Options
menu (Windows) or RStudio > Preferences
(Mac).
General > Basic
settings, change the option on Save workspace to .Rdata on exit
to be “Never.” Click the “Apply” button.Appearance
settings, customize the look of RStudio to something aesthetically appealing to you. When you are finished, click the “Apply” button.Accessibility
settings if you use a screen reader. If you change anything, don’t forget to click the “Apply” button.When you are finished customizing RStudio, click the “OK” button.
You may need to install some additional functionality to your system in order to get certain packages to install or load properly. On a Windows machine, you might need to install Rtools. Mac users might need to add the Command Line Tools. These tools also allow you to write and compile your own R packages. RStudio has well written instructions for adding these tools at: https://support.rstudio.com/hc/en-us/articles/200486498-Package-Development-Prerequisites.
When internet used to be dial-up (i.e., super slow, you wanted to choose a mirror site that was closest in proximity to your location as it sped up the download. This is less of a concern now that internet download speeds are much faster.↩︎