Intermediate R
Q68 / 100

What does the "switch()" function do in R?

Correct! Well done.

Incorrect.

The correct answer is B) Selects one of several alternatives based on the value of an expression, similar to a switch/case statement

B

Correct Answer

Selects one of several alternatives based on the value of an expression, similar to a switch/case statement

Explanation

switch(expr, case1 = result1, case2 = result2, ...) evaluates expr and returns the result corresponding to the matching case.

Progress
68/100