2.3 DOWNLOADING R AND RSTUDIO
It is time to switch programming languages. In this section we cover the same fundamental skills for the statistical programming language R that we did in the previous section for Python. In this chapter and throughout this book, you will find a lot of similarities in the way Python and R do things, such as saving output, and a lot of differences, such as importing packages.
To run R code, we need to download both R and RStudio. To download R, go to the R installation page,2 choose a mirror, and follow the directions for downloading R for your operating system. To download RStudio, go to the RStudio installation page3and select the download link for your operating system. After installation, locate RStudio and open it.
Figure 2.12 shows the RStudio window when you first open it. If you open RStudio and there are only three panels, click on File > New File > R Script to get the four‐panel display shown in Figure 2.12. The top‐left box...