Displaying 1 result from an estimated 1 matches for "cleanfactor".
Did you mean:
cleanfactors
2008 Dec 05
6
levels update
Hello,
I hope this question is not too stupid. I would like to know how to update
levels after subsetting data from a data.frame.
df <- data.frame(factor(c("a","a","c","b","b")), c(4,5,6,7,8), c(9,1,2,3,4))
names(df) <- c("X1","X2","X3")
my.sub <- subset(df, X1 == "a" | X1 == "b")