How do you convert a factor to a numeric data type in R?
a) as.factor()
b) as.numeric()
c) as.character()
d) as.logical()
Answer:
b) as.numeric()
Explanation:
The as.numeric()
function is used to convert factors to numeric data types in R.