Re: [R] rank/sort problem

2015-11-21 Thread David Winsemius
> On Nov 21, 2015, at 4:44 AM, Axel Urbiz wrote: > > Hello, > > I would like to sort the df below, such that it sorts y1 in decreasing order > for tt == 1 and in increasing order for > tt == 0. My solution is below, but curious if there might be something better > (meaning faster in this cas

Re: [R] rank/sort problem

2015-11-21 Thread Bert Gunter
I did not read your post in detail but have you not looked at ?rank ? Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Sat, Nov 21, 2015 at 4:44 AM, Axel Urbiz wrote: > Hello, > > I would like to

[R] rank/sort problem

2015-11-21 Thread Axel Urbiz
Hello, I would like to sort the df below, such that it sorts y1 in decreasing order for tt == 1 and in increasing order for tt == 0. My solution is below, but curious if there might be something better (meaning faster in this case). Actually, if instead if implicitly sorting, I could add a va