levels(x) levels(x) <- value
If value is a list and x is a factor, the method returns merge.levels(x, value). See merge.levels for details on how this may be used to combine or add levels to a factor.
levels(x)[levels(x)=="c"] <- "copper"levels(fac) <- c("A", "B", "A") # combine the first and third levels of a factor levels(fac) <- list(A=c("One","Three"), B="Two") # combine levels "One" and "Three" into "A" and rename "Two" "B".