Skip to content
Prev 8872 / 15274 Next

DBI solution

On Fri, Nov 4, 2011 at 7:08 PM, Ben Nachtrieb <ben.nachtrieb at gmail.com> wrote:
RpgSQL and RPostgreSQL are DBI-based drivers for R and the others are
higher level packages.

I can only address my own package but RpgSQL was developed for use
with sqldf.  It uses RJDBC (which uses JDBC and Java) and DBI.
Feedback is that RpgSQL is easier to install on Windows than
alternatives.  The use of RJDBC/JDBC may slow it down relative to
alternatives although speed may not be material if you are just
importing a bunch of time series and then working with them in R as
opposed to constantly going back to the database.

sqldf is a package that lets you use R data frames with several
database back-ends including RpgSQL.  You would not use sqldf with
your own database but might use it with R data frames to play around
with PostgreSQL.

Resources are

- the Installation info in this link:
  http://cran.r-project.org/web/packages/RpgSQL/index.html

- ?pgSQL help page (see example at end of page)

- http://sqldf.googlecode.com
  most of which is about sqldf and sqlite although much of it applies
and there is a bit about using  PostgreSQL with sqldf.