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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top