Skip to content
Prev 278098 / 398506 Next

count ties after rank?

On Nov 21, 2011, at 2:50 PM, Peter Langfelder wrote:

            
And if you wnat to know which ties are which you can do:

table(x)[table(x) > 1]
table() would ignore missing data (assuming it were properly NA not- 
valued).

 > x <- sample(c(1:10,NA,NA), 20, replace=TRUE)
 > table(x)[table(x) >1]
x
  1  4  7  9 10
  2  3  2  2  2
 > x
  [1]  7 10  3  9 NA NA  2  4 10 NA NA  4  5  9  6  4  1  1  7  8