0
0
R Programmingprogramming~5 mins

R Console and script files in R Programming - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AThe console closes.
BThe command runs immediately and shows the result.
CThe command opens a new script file.
DThe command is saved but not run.
Which file extension is used for R script files?
A.R
B.rscript
C.txt
D.rs
How can you run a single line of code from an R script in RStudio?
APress Ctrl+Enter or click 'Run'.
BPress Ctrl+S.
CClose the script file.
DType it again in the console.
Why is it better to use script files instead of only the console?
AScript files cannot be edited.
BConsole commands are faster.
CConsole commands are saved automatically.
DScript files save your commands for later use.
What does pressing Ctrl+S do in an R script window?
ARuns the script.
BCloses the script.
CSaves the script file.
DClears the console.
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.