Hello,

I am having a problem using sqldf.  I'm trying to choose a subset of
observations from a data set based on the date and maximum value of a
variable by date.

Here is the code I am using:

test<-sqldf("select distinct * from bextuse group by sdate having
bext=max(bext)",method="raw");

The result I get back is a data frame with 0 rows and 0 columns.  I have
tried the code in another program that utilizes SQL, and I retrieve the
14 rows I was expecting to get.
I looked at the SQLite information on the web, and it mentions that the
"having" clause can be used to select observations from grouped data
using aggregating functions.

Any help or advice is greatly appreciated.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to