Full_Name: Stephen Ponzio
Version: 2.3.1
OS: Windows
Submission from: (NULL) (199.67.138.42)


Given a vector of dates, sort returns a vector of numerics instead of dates.
This is different from the behavior in version 2.2, where dates were returned.
In this respect, sort is not equivalent to order.

> dates <- seq(Sys.Date(), len=5, by="1 day")

> dates[order(dates)]
[1] "2006-08-03" "2006-08-04" "2006-08-05" "2006-08-06" "2006-08-07"
> sort(dates)
[1] 13363 13364 13365 13366 13367

> class(dates[order(dates)])
[1] "Date"
> class(sort(dates))
[1] "numeric"

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to