Skip to content

Free certificate

R Programming Basics

10 questions, multiple choice. Score 8 or more and you can create a printable certificate with your name, today's date and a verification link. Everything happens in your browser; we store nothing.

Revise first

Every question comes from these free chapters. Read them, run the code in your browser, then take the check.

  1. Overview of R and RStudio
  2. Data structures
  3. Functions
  4. Statements and looping
Question 1

1. Which operator is the conventional way to assign a value to a variable in R?

Question 2

2. Which character starts a comment in an R script?

Question 3

3. What does this return?

x <- c(2, 4, 6)
length(x)
Question 4

4. What does this return?

x <- c(10, 20, 30)
x[2]
Question 5

5. A vector in R holds elements that are…

Question 6

6. How many rows and columns does this matrix have?

matrix(1:6, nrow = 2)
Question 7

7. What does this return?

mean(c(2, 4, 9))
Question 8

8. Which function builds a table with named columns of possibly different types?

Question 9

9. What does this return?

5 != 3
Question 10

10. How many numbers does this loop print?

for (i in 1:3) {
  print(i)
}

Pass mark: 8 of 10. Retry as often as you like.