How do you convert a numeric variable to an integer in R?

How do you convert a numeric variable to an integer in R?

a) as.numeric()
b) as.integer()
c) convert()
d) as.type()

Answer:

b) as.integer()

Explanation:

The as.integer() function is used to convert numeric variables to integers in R.

Scroll to Top