Recall & Review
beginner
What is the simplest way to print text in R?
Use the
print() function with the text inside quotes, like print("Hello, world!").Click to reveal answer
beginner
What does the following R code do?<br>
print("Hello, world!")It shows the text "Hello, world!" on the screen.
Click to reveal answer
beginner
How do you write a comment in R?
Start the line with
#. Anything after # is ignored by R.Click to reveal answer
beginner
What is the purpose of the
print() function in R?It shows information or results on the screen so you can see them.
Click to reveal answer
beginner
Can you run R code directly in the console?
Yes! You can type R commands in the console and press Enter to see results immediately.
Click to reveal answer
Which function prints text in R?
✗ Incorrect
The
print() function is used to display text or values in R.What will this code output?<br>
print("Hi there!")✗ Incorrect
The
print() function shows the text without quotes around it.How do you write a comment in R?
✗ Incorrect
In R, comments start with
#.What happens if you run
print(123) in R?✗ Incorrect
Numbers can be printed directly using
print().Where can you type R commands to run them immediately?
✗ Incorrect
The R console lets you type and run commands instantly.
Explain how to write and run your first R program that prints a message.
Think about how you tell R to show words on the screen.
You got /3 concepts.
Describe how comments work in R and why they are useful.
Comments are notes for people, not for the computer.
You got /3 concepts.