Advanced R
Q96 / 100

What is the difference between "missing(x)" and "is.null(x)" when checking function arguments?

Correct! Well done.

Incorrect.

The correct answer is B) missing(x) checks whether the argument x was supplied in the function call at all, while is.null(x) checks whether the value of x (which must be evaluable) is NULL

B

Correct Answer

missing(x) checks whether the argument x was supplied in the function call at all, while is.null(x) checks whether the value of x (which must be evaluable) is NULL

Explanation

missing() detects whether an argument was omitted from the call (without evaluating it), whereas is.null() requires evaluating the argument and checks if its resulting value is NULL.

Progress
96/100