Connecting GNU R to PostgreSQL
postgresql, r
Solution
Just for completeness, you have two more options
- RODBC which is very mature and feature-complete but doesn't correspond to the DBI framework as the PostgreSQL, MySQL, SQLite, Oracle, ... interfaces do. You also need to fiddle with ODBC setup files which can be tricky. But ODBC may be useful for other data access uses too.
- RdbiPgSQL from the BioConductor project which is also mature but uses yet another protocol that was to compete with DBI and never took of. This PostgreSQL package is featureful though.
But as a RPostgreSQL maintainer/co-author I am glad you found this one. As the other poster suggested, try `library(RPostgreSQL)` before issueing commands. If you encounter other problems, feel free to email me off-SO with a bug report.
Edit: There is another option of embedding R inside PostgreSQL using Joe Conway's PL/R.
Problem
I have `GNU R` installed (the `S-like` statistics package; version 2.8.1) and `PostgreSQL (8.4.1)`, but I cannot connect `GNU R` to my `RDBMS`. When I first did this (years ago - code lost) `DBI` for `R` didn't exist. Now it does. I am also confused as to which `R` package to use. A quick search returns: - RPostgreSQL seems to be the most up-to-date - `RPgSQL` Looks abandoned. I wish they would put a date on their webpage. ;-( My `Linux distribution` doesn't package `R` packages (irony) but I am comfortable running `R CMD INSTALL package.tar.gz`. I installed `RPostgreSQL`: a lot of documentation says to call `dbConnect` but I get the following error message: `Error: object "dbConnect" not found`.