3 Run R Basics Locally
Use these steps if you download R_basics.qmd from GitHub and want to run it on your own computer.
3.1 1. Install Required Software
- Install R: https://cran.r-project.org/
- Install RStudio Desktop: https://posit.co/download/rstudio-desktop/
- Install Quarto: https://quarto.org/docs/get-started/
3.2 2. Download the Lesson
Download the full repository from GitHub using Code > Download ZIP and unzip it.
3.3 3. Open in RStudio
- Open RStudio.
- Open the folder where you downloaded the files.
- Open
R_basics.qmd.
3.4 4. Run Code
- To run code interactively, execute chunks with
Cmd/Ctrl + Enter. - To render the full document click the Render button at the top of the R Studio screen.
- Or, you can render by creating a new chunk and typing this line of code:
quarto::quarto_render("R_basics.qmd", execute = TRUE)3.5 5. If Rendering Fails
- Install missing R packages shown in the error messages (for example
dplyr,ggplot2,readr). - Confirm Quarto is installed by typing into your Console: quarto::quarto_version()
- If quarto is installed the version number will appear.
- If quarto is not installed, install it from the quarto website using the URL provided at the top of this script.
- Be sure to save your script; then restart R Studio. Restarting RStudio is important because it refreshes the system PATH.
- Then recheck to make sure quarto is installed.