Re: [R] get maximum 3 rows by column elements in data frame

2015-11-09 Thread PIKAL Petr
Hi I am not completely sure what do you want, so here is my guess. > dat<-structure(list(Measure_id = c(1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, > 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, > 5), i = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4,

Re: [R] get maximum 3 rows by column elements in data frame

2015-11-09 Thread jim holtman
It is not entirely clear what you are asking for. Can you provide a sample of the output that you want from the data. Here is the data split by Measure_id, but not sure what to do with it: > split(x, x$Measure_id) $`1` Measure_id i j value rank 1 1 2 1 1.5 0.750 6