# Assign a string to a variable
rstudio_is_cool <- paste("R", "and", "RStudio", "work", "together!")
# Print the variable
rstudio_is_cool[1] "R and RStudio work together!"
RStudio IDE, Quarto, markdown
2026-01-13
These slides are only useful if you can match them to your computer.
.qmd and the markdown README.mdMarkdown is a lightweight markup language for creating formatted text using a plain-text editor.

R is a programming language and computing environment.

![]()
RStudio is an Integrated Development Environment (IDE) for R.

![]()
Quarto is an open-source scientific and technical publishing system built on Pandoc.

Customize!
I hate the default layout and always change it. You should figure out what works for you:
Tools > Global Options > Pane Layout

View, write, edit text:
Running code from source:
Cmd/Ctrl + Enter: run selected code (or current line)Cmd/Ctrl + Shift + Enter: run entire file
Console
Terminal
Background Jobs



R code can be run in both the console and source scripts, but they serve different purposes:
| Task | Source Script | Console |
|---|---|---|
| Quick calculations | ✓ | |
| Testing new functions | ✓ | |
| Creating objects | ✓ | |
| Data wrangling | ✓ | |
| Publication plots | ✓ | |
| Reproducible analyses | ✓ |
If you might need it again, use a source script.
Shows all objects loaded in your R session
Environment resets when R session restarts. Rerun code to recreate objects.

Directory navigator + working directory management
Working directory matters for file paths
"/Users/Natalie/Documents/repos/D2M-R/data/mydata.csv""data/mydata.csv"RStudio projects
.Rproj) sets working directory as project root

Perform basic git operations from RStudio

Packages pane:
install.packages() in codeHelp pane:
?function_name in consolePlots pane:
ggsave() for reproducibilityViewer pane:
Code vs. GUI
Nearly all pane actions have code equivalents. Only use GUI shortcuts for things you already know how to do in code!
.Rproj): manages project settings.R): contains (only) R code.md): contains (only) formatted text.qmd): contains combination of text, code, and formatting instructionsR Markdown vs. Quarto
R Markdown documents/notebooks (.Rmd) combine R code and markdown text to produce dynamic reports.
.Rmd = .R + .md
Quarto documents (.qmd) are the next generation of R Markdown notebooks, with more features and better multi-language support. Quarto is backward compatible with R Markdown, so all R Markdown documents can be used as Quarto documents.
.qmd = .Rmd^2
Unify your workflow producing a scientific report1, reduce errors, and save time.
Use one (1!) document to:
Create your RStudio project & repo
Create your Quarto .qmd document
Put code in “chunks” (inline .R scripts)
Write text with Quarto markdown
Customize YAML header
Cite sources with BibTeX
Set options for your output
Knit your document to desired format
.yaml and .yml--- at top and bottom{r}label option.R Filessource() to “inject” code from other filesMarkdown Text Content
<!-- comment -->`r code` syntax
README.md markdown file and setup.R scriptmanuscript.qmd document with:
source() and inline codeD2M-R I | Week 2