[R] Package for converting R datasets into SQL Server (create table and insert statements)?

Gabor Grothendieck ggrothendieck at gmail.com
Sat Oct 9 15:39:04 CEST 2010


On Sat, Oct 9, 2010 at 9:02 AM, johannes rara <johannesraja at gmail.com> wrote:
> Thanks, but I'm not looking for a function to save dataframes into a
> RDBMS. I'm looking for a function which creates CREATE TABLE and
> INSERT statements from a dataframe.
>

If the reason you want that is so you can manipulate R data frames in
SQL then the sqldf package does that.  There are no create statements
to issue and no insert statements to issue (although you can).  The
database is automatically created, the create and insert statements
are automatically generated and executed, your SQL statement is run,
the result is automatically retrieved and the database is
automatically destroyed afterwards.  You just specify a select or
other sql statement with the data frame name(s) replacing the table
name(s).  It works with built-in data frames that ship with R and with
data frames you create yourself.  See http://sqldf.googlecode.com for
more.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list