mood <- c("happy","unhappy","unhappy","happy") factor(mood, Levels = c("unhappy","happy"), ordered = FALSE)