Recall & Review
beginner Click to reveal answer
What is the simplest way to print text in R?
Use the
print() function with the text inside quotes, like print("Hello, world!").beginner Click to reveal answer
What does the following R code do?
print("Hello, world!")It shows the text "Hello, world!" on the screen.
beginner Click to reveal answer
How do you write a comment in R?
Start the line with
#. Anything after # is ignored by R.beginner Click to reveal answer
What is the purpose of the
print() function in R?It shows information or results on the screen so you can see them.
beginner Click to reveal answer
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.
Which function prints text in R?
✗ Incorrect
The
print() function is used to display text or values in R.What will this code output?
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.
