On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > sub$mm <- factor(sub$mm)
Great. This is exactly what I need. > is the simplest way to change a single factor in this way. To do a > whole data frame you just need a loop: > > drop_unused_levels <- function(data) > as.data.frame(lapply(data, function(x) if(is.factor(x)) > factor(x) else x )) Thanks for this additional information. Maybe I'll be in need of it later. Greetings, Claus ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
