Skip to content
Prev 385730 / 398503 Next

date

Hi,

Nice reproducible example.

rev(df$date2) isn't doing what you think it's doing - try looking at
it by itself.

Some digging into ?order will get you what you are after:

df[order(df$ID, df$date2, decreasing=c(FALSE, TRUE), method="radix"),]
ID      date2
2 A1 2005-01-27
1 A1 2004-09-17
3 A1 2003-05-07
4 A2 2017-05-21
5 A2 2016-09-12
6 A3 2013-01-25
7 A4 2019-09-27

Sarah
On Mon, Sep 21, 2020 at 2:41 PM Val <valkremk at gmail.com> wrote: