Displaying 1 result from an estimated 1 matches for "ordereda".
Did you mean:
ordered
2012 Jan 23
1
sqldf + Date class. Ordering and summary statistics appear to be incorrect.
...x()
and min() when the variable used is of class Date.
For example, if I run the following code:
=============== begin code =================
library(sqldf)
A<-data.frame(Dates=as.Date(c("1994-02-14","1977-02-23","2001-09-18","2009-08-01")),Ret=rnorm(4))
OrderedA<-sqldf('select * from A order by Dates')
MaxA<-sqldf('select max(Dates) as Dates from A')[1,1]
MinA<-sqldf('select min(Dates) as Dates from A')[1,1]
=============== end code =================
Then the result is this:
> A
Dates Ret
1 1994-02-14 1....