Prework
๐ฅ๏ธ 1. Download and Install the Software
Before the workshop, make sure you can open R and RStudio on your computer.
- From FWS Apps-To-Go, install:
- R 4.4.2 or newer
- RStudio 2024.09.1 or newer
In RStudio, go to Help โ About RStudio to confirm your version.
In the R console, type:
R.version.stringIf your versions are older, please update them.
Once installed, open RStudio to make sure it launches without errors.
๐ 2. Understanding RStudio Projects (for newer R users)
We will work inside an RStudio Project, which is like a self-contained folder that keeps all your files and code organized.
- An R Project keeps track of your working directory.
- All the files for this workshop will live inside one project folder.
- When you open the project, RStudio automatically sets that folder as your โhome base.โ
Think of an R Project as a container for your work. Instead of scattering files across your computer, everything you need is in one place.
๐ฆ 3. Download the Exercise Materials
Open RStudio and run this in the Console:
if (!require("usethis")) install.packages("usethis")
usethis::use_course("https://github.com/USFWS/intro-to-quarto-exercises/archive/refs/heads/main.zip")- RStudio may prompt you to open the new project folder โ click Yes.
- You should now see the RStudio title bar say:
intro-to-quarto-exercises-main. - If not, find the
intro-to-quarto-exercises-mainfolder and double-click the.Rprojfile.
๐ 4. Install R Package Dependencies
With the project open, run:
source("install_packages.R")The first time you install packages, it may take several minutes. Make sure youโre connected to the internet.
๐ 5. Install TinyTeX (for PDFs)
To render Quarto documents as a PDF, youโll need LaTeX.
Run:
tinytex::install_tinytex()You only need to install TinyTeX once. If you already have LaTeX, you can skip this step.
โ 6. Check Your Setup
Before the workshop, confirm:
quarto::quarto_check()๐งโ๐ป 7. Prework Assignment (Submit Before the Workshop)
Goal: Confirm your setup works end-to-end by rendering a Quarto document.
- In RStudio (with the
intro-to-quarto-exercises-mainproject open):- Go to File โ New File โ Quarto Documentโฆ
- Choose HTML format and title it โPrework Checkโ.
- Replace the starter text with:
# Hello Quarto!
- **Name:** YOUR NAME
- **Fun fact:** FUN FACT ABOUT YOU
```{.r}
#| echo: true
#| message: false
#| warning: false
sessionInfo()
```- Click Render to create the HTML output.
- (Optional) Also render to PDF:
- In the YAML header, add
format: pdf. - Render again to produce a PDF.
- In the YAML header, add
- The rendered HTML file (and PDF if you tried it).
- A screenshot of RStudio showing:
- The project name
intro-to-quarto-exercises-mainin the title bar. - The rendered output in the Viewer/Preview pane.
- The project name