Answers for "what is the use of factor type variable ? in r"

R
0

what is factor in r programming

# Create a vector as input.
data <- c("East","West","East","North","North","East","West","West","West","East","North")

print(data)
print(is.factor(data))

# Apply the factor function.
factor_data <- factor(data)

print(factor_data)
print(is.factor(factor_data))
Posted by: Guest on October-31-2020

Code answers related to "what is the use of factor type variable ? in r"

Browse Popular Code Answers by Language