Is anyone using R with postgres? I'd like to do so, but cannot seem to find any reasonable explanation of how to do so. Joshua Gramlich Chicago, IL
On 11 Feb 2003, Joshua Gramlich wrote:> Is anyone using R with postgres? I'd like to do so, but cannot seem to > find any reasonable explanation of how to do so. > > > Joshua Gramlich > Chicago, ILlibrary(RPgSQL) # It isn't in an obvious place: # http://lib.stat.cmu.edu/R/CRAN/src/contrib/Devel db.connect() db.ls() Dave, -- Dave Forrest (434)924-3954w(111B) (804)642-0662h (804)695-2026p drf5n at virginia.edu http://mug.sys.virginia.edu/~drf5n/
Dear David and Joshua, One can also access PostgreSQL via the RODBC package. There's more information in section 4 of the R Data Import/Export manual, which is part of the R distribution and is also available on CRAN. John At 04:08 PM 2/11/2003 -0500, David Forrest wrote:>On 11 Feb 2003, Joshua Gramlich wrote: > > > Is anyone using R with postgres? I'd like to do so, but cannot seem to > > find any reasonable explanation of how to do so. > > > > > > Joshua Gramlich > > Chicago, IL > >library(RPgSQL) # It isn't in an obvious place: > # http://lib.stat.cmu.edu/R/CRAN/src/contrib/Devel >db.connect() >db.ls() > >Dave, >-- > Dave Forrest (434)924-3954w(111B) (804)642-0662h (804)695-2026p > drf5n at virginia.edu http://mug.sys.virginia.edu/~drf5n/----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox -----------------------------------------------------
Yes, I do. Here's a code snippet that worked for me: library(RPgSQL) db.connect(dbname='fgdata') fgdata.df<-db.read.table('mlm_data') This assumes you have the RPgSQL library installed, and that you have postgres running on the local machine. There's more documentation in the RPgSQL package. Best, Andy Perrin ---------------------------------------------------------------------- Andrew J Perrin - http://www.unc.edu/~aperrin Assistant Professor of Sociology, U of North Carolina, Chapel Hill clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu On 11 Feb 2003, Joshua Gramlich wrote:> Is anyone using R with postgres? I'd like to do so, but cannot seem to > find any reasonable explanation of how to do so. > > > Joshua Gramlich > Chicago, IL > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help >
> Is anyone using R with postgres? I'd like to do so, but cannot seem to > find any reasonable explanation of how to do so.Lots of us do. There is a confusingly wide selection of connection mechanisms available, I mostly stick with RODBC as I can then use the same code snippets under Windoze and Linux. But I also use the RPgSQL (sp?) module directly. Where exactly are you faltering? Dirk, also in Chicago -- According to the latest figures, 43% of all signatures are totally worthless.