Skip to content
Prev 308730 / 398503 Next

How to pick colums from a ragged array?

Hello,

I'm not sure I understand it well, in the solution below the only 
returned value is ID == 814 but it's not the first nor the last DATE.

how.many <- ave(id.d[,1], id.d[,1], id.d[,2], FUN = length)
id.d[how.many > 1, ]

See the help page for ?ave if the repetition of id.d[,1] is confusing. 
The first is the vector to average (to apply FUN to) and the second is 
one of thw two vectors defining the groups.

Hope this helps,

Rui Barradas
Em 23-10-2012 10:37, Stuart Leask escreveu: