Displaying 2 results from an estimated 2 matches for "value180".
Did you mean:
value120
2010 Jul 24
4
Trouble retrieving the second largest value from each row of a data.frame
...ted data.frame. Retrieving the largest value was easy, but I have been getting errors every way I have tried to retrieve the second largest value. I have not even tried to retrieve the labels for the value yet.
Any help would be appreciated
Mike
> data<-data.frame(value0,value60,value120,value180,value240,value300)
> data
value0 value60 value120 value180 value240 value300
1 -13007 -11707 -11072 -12471 -12838 -13357
2 -12838 -13210 -11176 -11799 -13210 -13845
3 -12880 -11778 -11113 -12439 -13089 -13880
4 -12805 -11653 -11071 -12385 -11561 -13317...
2010 Jul 26
1
After writing data in MMF using SEXP structure, can i reference in R?
...146 -11779 -12537
Putting it all together:
matrix( paste( t(apply(x, 1, sort, decreasing=TRUE)[1:3, ]),
names(x)[ t(apply(x, 1, order, decreasing=TRUE)
[1:3, ]) ]),
ncol=3)
[, 1] [, 2] [, 3]
[1, ] "-11072 value120" "-11707 value60" "-12471 value180"
[2, ] "-11176 value120" "-11799 value180" "-12838 value0"
[3, ] "-11113 value120" "-11778 value60" "-12439 value180"
[4, ] "-11071 value120" "-11561 value240" "-11653 value60"
[5, ] &...