Recall & Review
beginner
What is the R Console used for?
The R Console is where you type and run R commands one at a time. It shows results immediately, like a chat with the computer.
Click to reveal answer
beginner
What is an R script file?
An R script file is a text file that holds many R commands saved together. You can run the whole file to do tasks step-by-step.
Click to reveal answer
beginner
How do you run an R script file in RStudio?
You can run an R script by clicking the 'Run' button or pressing Ctrl+Enter to run the current line or selection.
Click to reveal answer
beginner
Why use script files instead of typing commands only in the console?
Script files save your work so you can reuse or fix it later. The console forgets commands after you close it.
Click to reveal answer
beginner
How can you save your R script file?
You save an R script file by clicking 'File' > 'Save' or pressing Ctrl+S, then choosing a name with '.R' extension.
Click to reveal answer
What happens when you type a command in the R Console and press Enter?
✗ Incorrect
Typing a command in the R Console and pressing Enter runs it right away and shows the output.
Which file extension is used for R script files?
✗ Incorrect
R script files use the '.R' extension to identify them as R code files.
How can you run a single line of code from an R script in RStudio?
✗ Incorrect
Ctrl+Enter or the 'Run' button runs the current line or selected code from the script.
Why is it better to use script files instead of only the console?
✗ Incorrect
Script files keep your commands saved so you can reuse or fix them anytime.
What does pressing Ctrl+S do in an R script window?
✗ Incorrect
Ctrl+S saves the current script file to your computer.
Explain the difference between using the R Console and an R script file.
Think about how you work with quick commands versus saving your work.
You got /4 concepts.
Describe the steps to create, run, and save an R script file in RStudio.
Imagine writing a recipe, testing it, and saving it for later.
You got /4 concepts.