Get the most from each lesson's Rscript editor—the same habits transfer to RStudio, VS Code with R extension, and CI running Rscript tests/testthat.R.
Recommended workflow
- Read the concept section before editing code.
- Click Run to execute with
Rscript. - Use
print()for values andcat()for formatted output without auto quotes. - Fix errors top to bottom—R stops at the first error in a statement.
What the runner can and cannot do
- Can — single-file scripts with base R:
print(), vectors,data.frame() - Needs local setup —
library(dplyr), ggplot2, R Markdown, Shiny, renv projects
Compare workflows with Python and SQL tracks.
Important interview questions and answers
- Q: What prints output in R lessons?
A:print()shows values;cat()writes strings without default quoting. - Q: Can you load dplyr in the playground?
A: Lessons teach dplyr in prose for local install—playground code uses base R equivalents.
Self-check
- What function prints without adding quotes around strings?
- What command runs a script locally?
Challenge
First Rscript run
- Click Run with the default code.
- Confirm output appears in the terminal.
- Add a second
print()orcat()line with your name.
Done when: the terminal shows the default message and your custom line.
Challenge
Verify Rscript output
- Run the default program.
- Confirm output in the terminal.
- Add a deliberate syntax error and read the message.
- Fix and run again.
Done when: you see an error when appropriate and clean output after fixing.
Interview prep
- What runs code in the playground?
Rscriptexecutes your script—useprint()andcat()for output.