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

2015-11-09 Thread PIKAL Petr
5 2 4 2.01 5.20 5 4 3 2.01 Is this what you wanted? Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ragia > Ibrahim > Sent: Monday, November 09, 2015 11:55 AM > To: r-help@r-project.org > Subject: [

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

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

2015-11-09 Thread Ragia Ibrahim
Dear group, I have the following data freame dput(df_all_nodes) 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, 5, 5, 5, 5,