> I want to sort a DF, temp, on two columns, patid and time. I have searched
> the internet and found code that I was able to modify to get my data sorted.
> Unfortunately I don't understand how the code works. I would appreciate it
> if someone could explain to me how the code works. Among other
Hello,
Though good answers were already given, I would like to say something.
1.
If you are lazy (typing), use with, if you prefer to play safe, don't.
I am lazy many times, but in interactive mode only.
2.
I find it better in the long run *not* to take advantage of R's
one-liners, they tend
With this as an example, no wonder you don't understand it. This is horrible.
`with` is very much like the `subset` function... it alleviates the need to
re-type the containing object name repeatedly.
data4xsort <- temp[ with( temp, order( patid, time ) ), ]
is the same as
data4xsort <- temp[
Bert,
Thank you for your reply (and the many other questions to the list that you
answer).
I understand how order works when ordering based on a single column. What I
don’t understand is how the code I included with my email works. I believe my
problem is a lack of understanding of what with
On 8/12/19 7:20 PM, Sorkin, John wrote:
I want to sort a DF, temp, on two columns, patid and time. I have searched the
internet and found code that I was able to modify to get my data sorted.
Unfortunately I don't understand how the code works. I would appreciate it if
someone could explain
https://stackoverflow.com/questions/2315601/understanding-the-order-function
Do a web search on "How does order() work R" or similar for more.
I can't explain with() any better than the docs: saying that it evaluates
the expression argument in the data argument environment -- a data frame
for
I want to sort a DF, temp, on two columns, patid and time. I have searched the
internet and found code that I was able to modify to get my data sorted.
Unfortunately I don't understand how the code works. I would appreciate it if
someone could explain to me how the code works. Among other
7 matches
Mail list logo