I've been using the sqldf package for quite a while using the SQLite drive, which came by default.
However, now I want to leverage PostgreSQL's window functions. I've installed RPostgresSQL and I think I'm correctly using the options sqldf's documentation specifies. But even if I try to do a simple query specifying or not the drive and dbname, an error message is returned:
library(RPostgreSQL)
library(sqldf) # the R console returns "sqldf will default to using PostgreSQL"
df = data.frame(color=c("red","blue"),value=c(10,20))
sqldf("select * from df")
sqldf("select * from df",drv="PostgreSQL",dbname=getOption("sqldf.RPostgreSQL.dbname"))
The error message returned is the following:
Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (could not connect postgres@localhost on dbname "test" ) Error in !dbPreExists : invalid argument type
What am I missing?