Installing R
Installing R and RStudio
In this course, we will use RStudio to perform necessary visualizations and analyses and to create web-based reports.
R and RStudio are not the same thing. R is like the engine in a car, and RStudio is the driver’s controls. We don’t need to know the guts of a combustion engine to drive, and we don’t need to know what’s going on in R, but we do need it on our computer.
To install R and RStudio on your computer, please follow these instructions:
- Go to the R-Studio page and follow the instructions:
a. Install R. The “Download and Install R” button will take you to the R website. You will have to click through a few links to get to the download.- For PC: “Download R for Windows” > “Install R for the first time” > Whatever the latest version is will be at the top.
- For Mac: “Download R for Mac” > There will be 2 options on the left with the latest version of R (R-4.4.3, for example). Which version you download depends on what kind of processor chip you have, but most will work with the version ending in “arm64.pkg”
- For PC: “Download R for Windows” > “Install R for the first time” > Whatever the latest version is will be at the top.
- Return to the R-studio download page and click the “Download RStudio Desktop” button. Run the downloaded program and accept the defaults.
Once the RStudio installer downloads, open the resulting file.
Click “Continue” or “Okay” or “Accept” for all of the several various windows that will appear.
Once the installation finishes you can use your computer’s search bar to search for “RStudio” in your apps.
Chromebooks and Cloud-based Notebooks
NOTE: If you are using a Chromebook or other “web browsing only” computer that will not allow you to install software locally, then set up an account at RStudio Cloud instead of installing R and RStudio as shown above. Use your BYU-I email and user ID.
Testing R-Studio
Throughout this course, you will download many files. The collection of files will be a valuable resource if you go on to use R in the future.
- Create a folder somewhere that is easy to find. Consider naming it “M221D” or another descriptive name
- Download the course material and move the Student_Work folder to your course folder created in step 1.
- Open the “Test.qmd” file in R-Studio from the 1-Getting_Started folder.
- At the top of the R-Studio document window, click the “Render” button.
If everything worked, R should open up a browser window in your default web browser with some text and a chart. If it runs, you’re technology is set up for success in this class!
Once you have “Rendered” the document, R will also create a .html
file in the same file location as where you saved your Student_Work folder. If you have followed the above instructions, this will look like “Student_Work/1-Getting_Started/Test.html”.
Upload the “Test.html” file into Canvas to demonstrate that it works.
Keep Calm
If you have tried going through these instructions and it isn’t working, come to class and we will help troubleshoot.
Troubleshooting Macs
Mac Processing Chip
For Macs, Which version of R-Studio you download depends on which processing chip you have. If you followed the instructions above and R-Studio opens but gives you a big error, you need to download the other version of R linked above.