spka...@gmail.com
unread,Jun 22, 2017, 8:31:14 AM6/22/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqldf
Every example from sqldf.Rd with a select statement fails when run with the new version of RSQLite (2.0).
Some of the example code:
packageVersion("sqldf")
packageVersion("RSQLite")
library("sqldf")
### Name: sqldf
### Title: SQL select on data frames
### Aliases: sqldf
### Keywords: manip
### ** Examples
#
# These examples show how to run a variety of data frame manipulations
# in R without SQL and then again with SQL
#
# head
a1r <- head(warpbreaks)
## FAILS:
a1s <- sqldf("select * from warpbreaks limit 6")
identical(a1r, a1s)
# subset
a2r <- subset(CO2, grepl("^Qn", Plant))
## FAILS:
a2s <- sqldf("select * from CO2 where Plant like 'Qn%'")
all.equal(as.data.frame(a2r), a2s)
data(farms, package = "MASS")
a3r <- subset(farms, Manag %in% c("BF", "HF"))
## FAILS:
a3s <- sqldf("select * from farms where Manag in ('BF', 'HF')")
row.names(a3r) <- NULL
identical(a3r, a3s)
a4r <- subset(warpbreaks, breaks >= 20 & breaks <= 30)
## FAILS:
a4s <- sqldf("select * from warpbreaks where breaks between 20 and 30",
row.names = TRUE)
identical(a4r, a4s)
a5r <- subset(farms, Mois == 'M1')
## FAILS:
a5s <- sqldf("select * from farms where Mois = 'M1'", row.names = TRUE)
identical(a5r, a5s)
a6r <- subset(farms, Mois == 'M2')
## FAILS:
a6s <- sqldf("select * from farms where Mois = 'M2'", row.names = TRUE)