Adrian Dusa wrote:
Adrian Dusa <dusa.adrian <at> gmail.com> writes:
[...snip...]
f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
[1] a a
Levels: a
Or, more simple:
f[f %in% names(table(f))[table(f) >= 2], drop=TRUE]
[1] a a
Levels: a
Adrian
Also see the combine.levels function in the Hmisc package.
Frank
______________________________________________
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.
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
______________________________________________
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.