Hilmar Berger <hilmar.berger <at> imise.uni-leipzig.de> writes:
...
> So, is there any way in drop the unused factor levels from *all* factors 
> of a data frame without import/export ?

There is a generic drop.levels in gdata. Here is part of its help page:

"\code{drop.levels} is a generic function, where default method does
nothing, while method for factor \code{s} drops all unused levels.
There are also convenient methods for \code{list} and \code{data.frame},
where all unused levels are dropped in all factors (one by one) in a
\code{list} or a \code{data.frame}."

Gregor

______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to