How about update R/sqldf?

> require(sqlf)
Loading required package: sqlf
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return
= TRUE,  :
  there is no package called 'sqlf'
>
> testframe<-data.frame(sdate=rep(paste
+ ("day",1:5,sep=""),each=5),bext=runif(25,1,100),otherstuff=runif
+ (25,45,60),stuff=runif(25,3,25))
>
>
> maxdays<-sqldf("select distinct * from testframe group by sdate having
bext=max(bext)")
> maxdays
  sdate     bext otherstuff     stuff
1  day1 77.20252   51.77503 12.045835
2  day2 91.37352   50.07259  4.468679
3  day5 74.29047   58.58456 10.027444

        [[alternative HTML version deleted]]

______________________________________________
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