Factor
  • categorize the data and store it as levels
  • Create Factor
    A <- factor(c("East","West","East","North"))
    print(A)
    
    B <- factor(c(1,2,2,3,1,2,3,3,1,2,3,3,1))
    print(B)
    
    levels(B) = c('I', 'II', 'III')
    print(B)