[STATSGRASS] Re: Connecting to databases on Windows using R
Roger Bivand
Roger.Bivand at nhh.no
Thu Mar 17 16:19:54 EST 2005
On Thu, 17 Mar 2005, Markus Neteler wrote:
> Craig,
>
> it complains loudly even on Linux... sigh. Things changed again,
> I'll have to update the indicated web page (how to use install.packages()
> with bioconductor?).
>
> Downloading and installing on command line should work (on Linux,
> maybe even Cygwin).
Yes, these are source packages, unless some Windows-built packages exist
(not cygwin, use MSYS and mingw to compile I think). But maybe look at the
BioConductor site a bit more - there seems at least to be a Win32 binary
there:
http://www.bioconductor.org/repository/release1.5/package/html/index.html
Download
http://www.bioconductor.org/repository/release1.5/package/Win32/Rdbi_1.0.4.zip
and install package from local zip file. There is no pre-built Windows
binary for RdbiPgSQL, though, suggesting that the combination of Windows
and PostgreSQL isn't easy and depends on the local libraries and headers.
Hope you have some luck!
Roger
>
> Markus
>
> On Thu, Mar 17, 2005 at 01:54:10PM -0700, Craig Aumann wrote:
> >
> > Well I'm curious to know what R on Windows actually does with the
> > following commands:
> >
> > install.packages(contriburl="http://www.bioconductor.org/repository/devel/package/Source/","Rdbi")
> > install.packages(contriburl="http://www.bioconductor.org/repository/devel/package/Source/","RdbiPgSQL")
> >
> > Does it successully install the packages, or complain loudly?
> >
> >
> > On Thu, 2005-03-17 at 13:30, Markus Neteler wrote:
> > > Hi
> > >
> > > (for me) it's strange that Rdbi doesn't appear on CRAN but
> > > I was already notified once not to discuss Rdbi questions on
> > > the R Mailing lists... (so better to ask here :-)
> > >
> > > Anyway, I have compiled some usage instructions here:
> > > http://grass.itc.it/statsgrass/r_and_dbms.html
> > > which should be more or less still valid.
> > >
> > > Maybe a bit helpful, also comparing speed of Rdbi and RODBC.
> > > However, it doesn't cover MS-Win installation...
> > >
> > > Best
> > >
> > > Markus
> > >
> > > On Thu, Mar 17, 2005 at 11:33:02AM -0700, Craig Aumann wrote:
> > > > See Teague's question below. As a linux person, I don't know the answer
> > > > to this so am forward this message to the list.
> > > >
> > > > Having looked also at http://www.bioconductor.org/ - which links off of
> > > > the main R web page, I see a Windows version of Rdbi (click "What is
> > > > Bioconductor" and scroll down till you find the heading: "Database
> > > > Interaction"). I'm seeing a RDBI for Windows, but no windows version of
> > > > RdbiPgsql which is a problem!
> > > >
> > > > Have you tried sending a message to the R-Help list about this - how do
> > > > windows users access PGSQL databases from R? (R website -> mailing
> > > > lists.)
> > > >
> > > > On the CRAN site, just searching databases, I saw the following:
> > > > DBI, RMySQL, RODBC, ROracle. Not sure if windows versions exist for any
> > > > of these.
> > > >
> > > > Also have a look at the links in
> > > > http://cran.r-project.org/doc/manuals/R-data.html .
> > > >
> > > > Afraid that's all I know about attaching to Databases on Windows - which
> > > > ain't much I'm afraid.
> > > >
> > > > Cheers!
> > > > Craig
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, 2005-03-17 at 10:40, Teague O'Mara wrote:
> > > > > Hi Craig. I came back across this email from awhile ago. I'm attempting to
> > > > > look at cluster of points in GRASS and have been using the script that Michael
> > > > > Barton wrote, but I'd like to look at a few other things and it seems that using
> > > > > R and my GRASS data will be much easier. I have been using R for basic
> > > > > statistics, but am far from being fluent with it. If you have a moment, can you
> > > > > help me out with some R issues? I'm using an XP machine with R 2.0.1.
> > > > >
> > > > > I'm having a problem downloading and installing Rdbi and RdbiPgSQL. I can't
> > > > > find these two sets, or any SQL interface that will download from CRAN. I was
> > > > > able to download these directly from sourcforge (tar.gz format), but I'm not
> > > > > sure what to do with them now. Is it an issue with this version of R?
> > > > >
> > > > > Thanks for any help you can offer.
> > > > >
> > > > > Cheers--
> > > > > Teague
> > > > >
> > > > >
> > > > >
> > > > > Teague O'Mara
> > > > > Department of Anthropology
> > > > > Arizona State University
> > > > > Box 872402
> > > > > Tempe, AZ 85287-2402
> > > > > 480.965.6213
> > > > >
> > > > >
> > > > > Quoting Craig Aumann <caumann at ualberta.ca>:
> > > > >
> > > > > > In glancing at your script, I wondered why you didn't just import the
> > > > > > stuff into a statistical package like R and then use all the
> > > > > > clustering
> > > > > > routines it has. See www.r-project.org
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ## Key commands in R are:
> > > > > >
> > > > > > ## Load the packages to access the database, in particular the PgSQL
> > > > > > ##
> > > > > > database
> > > > > > require(Rdbi)
> > > > > > require(RdbiPgSQL)
> > > > > >
> > > > > > ## Load some clustering routines
> > > > > >
> > > > > > require(cluster)
> > > > > > require(mclust)
> > > > > >
> > > > > >
> > > > > > ### Connect to the database and read in a points data set "jogis"
> > > > > > ## and read in the dataset "wells_att".
> > > > > >
> > > > > >
> > > > > > conn <- dbConnect(PgSQL(), dbname="jogis", user="caumann")
> > > > > > wells <- dbReadTable(conn, "wells_att")
> > > > > > dbDisconnect(conn)
> > > > > >
> > > > > > ## Now you can apply any clustering or kernel smoothing technique you
> > > > > > want to the dataset.
> > > > > >
> > > > > > If this is of any help, let me know and I can provide more details.
> > > > > > Cheers!
> > > > > > Craig
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > _______________________________________________
> > > > statsgrass mailing list
> > > > statsgrass at grass.itc.it
> > > > http://grass.itc.it/mailman/listinfo/statsgrass
>
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
More information about the grass-stats
mailing list