Skip to content
Prev 423 / 1559 Next

Is any database particularly better at "exchanging" large datasets with R?

On 6 Feb 2008, at 21:49, Paul Gilbert wrote:

            
There is - take a look here:

http://www.bioconductor.org/packages/release/Software.html

Install both "Rdbi" and "RdbiPgSQL". These work amazingly well for me.

I put a line like this in my .Rprofile:

my_db = dbConnect(psql, user="user_name", host="localhost",  
dbname="db_name")

...with the appropriate values substituted.

Then I have defined:

sqlQuery = function(query)
{
         result = dbSendQuery(my_db, query)
         return(dbGetResult(result))
}

This is then all in the background, so to perform a query, I use:

data = sqlQuery("SELECT ....")

and the result is a data frame.

Cheers,

Demitri