![]() |
VOOZH | about |
as.factor() function in R Programming Language is used to convert the passed object(usually Vector) into a Factor.
Syntax: as.factor(object)
Parameters:
- Object: Vector to be converted
Output:
[1] female male male female Levels: female male
Here we are applying this function to the integer vector
Output:
[1] 11.1 3.11 32.2 2.2 Levels: 11.1 2.2 3.11 32.2