Skip to content
Prev 87001 / 398502 Next

elements that appear only once

Hi Dmitris, and list
On 22 Feb 2006, at 09:24, Dimitris Rizopoulos wrote:

            
well, thank you for this (which() is good here!) but this is still  
"inelegant" IMHO
because it uses the names() of a table.

If I had

 > a <- as.factor(c(1,1,1,2,3,4,4,4,4,5))
 > names(which(table(a)==1))
[1] "2" "3" "5"
 >

this gives a character vector.

I could coerce using  as.integer() here, but this seems so....inelegant.

best wishes


Robin
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743