Skip to content
Prev 304268 / 398503 Next

Changing entries of column of type "factor"/Adding a new level to a factor

On Aug 27, 2012, at 12:18 PM, Bert Gunter wrote:

            
Then do it this way (different from what I thought was originally  
desired):

 > x <- factor(letters[1:3])
 > levels(x) <- c("d", levels(x)[2:3])
 > x
[1] d b c
Levels: d b c
So the above method might be what you expect. Several options are now  
available to the questioner.