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 ______________________________________________ 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.