[R] SQL Primer for R

Gabor Grothendieck ggrothendieck at gmail.com
Mon Aug 25 15:24:49 CEST 2008


The sqldf package's home page

http://sqldf.googlecode.com

has quite a few examples as well as links to resources.  Also see the
examples in ?sqldf

On Mon, Aug 25, 2008 at 9:12 AM, ivo welch <ivowel at gmail.com> wrote:
> Dear R wizards:
>
> I decided to take the advice in the R data import/export manual and
> want to learn how to work with SQL for large data sets.  I am trying
> SQLite with the DBI and RSQLite database interfaces.  Speed is nice.
> Alas, I am struggling to find a tutorial that is geared for the kind
> of standard operations that I would want in R.  Simple things:
>
> *  how to determine the number of rows in a table.  (Of course, I
> could select a row of data and then use this.)
>
> *  how to insert a new column into my existing SQL table---say, the
> rank of another variable---and save it back.  Am I supposed to create
> a new data frame, then save it as a new table, then delete the old SQL
> table?
>
> *  how to save a revised version of my table in a different sort order
>  (with or without deleting the original table).  <-- I guess this is
> not appropriate, as I should think of SQL tables as unordered.
>
> I guess these would make nice little text snippets in the R Data
> import/export manual, too.  help appreciated.
>
> regards,
>
> /ivo
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list