#Factors in R Language.
data <- c("East","West","North","North","East","West")

#Apply the Factor Function.
factor_data <- factor(data)

print(factor_data)

#generatiin factor levels
#3 is an integer giving the number of levels.
#4 is an interger giving the number of replications.

v <- gl(3,4 lables = c("abc","def","asc",))
print(v)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: