Which function is used to check if a variable is a factor in R?
a) is.factor()
b) is.numeric()
c) is.logical()
d) is.character()
Answer:
a) is.factor()
Explanation:
The is.factor()
function checks if a variable is of type factor, which is used to handle categorical data in R.