wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

R Quiz

Total questions: 10

Worksheet time: 15mins

Name
Class
Date
1.

What is the type of variable x?

a)

logic

b)

numeric

c)

character

d)

complex

2.

What is the type of variable y?

a)

numeric

b)

complex

c)

logical

d)

character

3.

What type of data structure is z?

a)

list

b)

matrix

c)

data frame

d)

vector

4.

What type of data structure is t?

a)

matrix

b)

list

c)

vector

d)

string

5.

What is the output of the R code in the image?

a)

1,1,2,2

b)

2,2

c)

3,3

d)

1,2,3

6.

What R function is used to create a matrix object?

a)

matrix()

b)

vector()

c)

array()

d)

2D_array()

7.

What is the output of the R code in the image?

a)

2

b)

5

c)

4

d)

3

8.

What is the output of the function in the image if we call mystery(2)?

a)

x

b)

2

c)

8

d)

mystery

9.

Which of these commands implements an infinite loop in R?

a)

repeat

b)

while

c)

for

d)

if

10.

What is the output of the function in the image if we call f(3,2)?

a)

3,2

b)

5

c)

32

d)

6