Skip to content
Prev 87006 / 398502 Next

elements that appear only once

On Wed, 22 Feb 2006, Robin Hankin wrote:

            
Since the names of the table are the levels of the factor, I would use

levels(a)[table(a) %in% 1]

Well, almost.  If you have NA or NaN as a factor level then all these 
solutions need to be more complicated.
But a has a character vector of levels, and there is nothing there to tell 
R that you wanted integers and not decimal-digit character strings.