0
0
R Programmingprogramming~10 mins

Why operators drive computation in R Programming - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add two numbers and print the result.

R Programming
result <- 5 [1] 3
print(result)
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication instead of addition.
2fill in blank
medium

Complete the code to multiply two numbers and print the result.

R Programming
result <- 4 [1] 7
print(result)
Drag options to blanks, or click blank then click option'
A/
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or division instead of multiplication.
3fill in blank
hard

Fix the error in the code to divide two numbers and print the result.

R Programming
result <- 10 [1] 2
print(result)
Drag options to blanks, or click blank then click option'
A*
B+
C/
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication or subtraction instead of division.
4fill in blank
hard

Fill both blanks to create a named vector with names for the numbers 4 and 5.

R Programming
squares <- c([1] = 4, [2] = 5)
print(squares)
Drag options to blanks, or click blank then click option'
Afour
Bsix
Cfive
Dseven
Attempts:
3 left
💡 Hint
Common Mistakes
Using names that do not match the vector values.
5fill in blank
hard

Fill all three blanks to create a vector of numbers, filter those greater than 3, and square them.

R Programming
numbers <- c([1], [2], [3])
squares <- numbers[numbers > 3]^2
print(squares)
Drag options to blanks, or click blank then click option'
A2
B4
C5
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using only numbers less than or equal to 3.