Yuan Jian <jayuan2008 <at> yahoo.com> writes:

> [...snip...]
> 
> I want to remove level b because level b has less than 2.
> > f
> [1] a a
> Levels: a


> f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
[1] a a
Levels: a

HTH,
Adrian

______________________________________________
R-help@r-project.org 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