[R] Question regarding sqldf

Rizzo.Michael at epamail.epa.gov Rizzo.Michael at epamail.epa.gov
Fri Jul 31 15:40:36 CEST 2009


My sqldf package was already updated. The result from the example you
ran is also missing 2 of the five days so something still isn't working
correctly.




|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------|
  |milton ruser <milton.ruser at gmail.com>                                                                                                       |
  >--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------|
  |Michael Rizzo/RTP/USEPA/US at EPA                                                                                                              |
  >--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Cc:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------|
  |r-help at r-project.org                                                                                                                        |
  >--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------|
  |07/30/2009 05:56 PM                                                                                                                         |
  >--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [R] Question regarding sqldf                                                                                                            |
  >--------------------------------------------------------------------------------------------------------------------------------------------|





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






More information about the R-help mailing list