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)