How can you check if a variable is numeric in R?

How can you check if a variable is numeric in R?

a) is.character()
b) is.logical()
c) is.numeric()
d) is.double()

Answer:

c) is.numeric()

Explanation:

The is.numeric() function returns TRUE if the variable is numeric, otherwise FALSE.

Scroll to Top