[STATSGRASS] Re: Connecting to databases on Windows using R

Roger Bivand Roger.Bivand at nhh.no
Thu Mar 17 16:22:44 EST 2005


On Thu, 17 Mar 2005, Markus Neteler wrote:

> On Thu, Mar 17, 2005 at 02:11:16PM -0700, Teague O'Mara wrote:
> > Craig and Markus:
> > 
> > Just trying it I get the same complaint for both:
> > 
> > trying URL `http://www.bioconductor.org/repository/devel/package/Source//PACKAGES'
> > Error in download.file(url = paste(contriburl, "PACKAGES", sep = "/"),  : 
> >         cannot open URL
> > `http://www.bioconductor.org/repository/devel/package/Source//PACKAGES'
> > In addition: Warning message: 
> > cannot open: HTTP status was `404 Not Found' 
> > 
> > Apparently the page has moved, or the packages have been taken off?
> 
> the packages *are* there, but they have disabled the nice installation method
> somehow. I am googling for > 20min now, to no avail.
> 
> http://www.bioconductor.org/repository/devel/package/html/index.html
> ->  Rdbi -> Source package download
> ->  RdbiPgSQL -> Source package download
> 
> Save to disk. Then first install Rdbi, then RdbiPgSQL.
> Ah, for MS-Win you want to grab the .zip files instead.
> 
>  
> > Also, Rdbi will load, but I get the following message:
> > Loading required package: Rdbi 
> > [1] TRUE
> > Warning message: 
> > package 'Rdbi' was built under R version 2.1.0
> > 
> > I searched around for a new version of R, but it seems that 2.0.1 is the latest
> > version.  Or is 2.1 new source code for Linux?
> 
> Maybe the maintainer of the package is a bit ahead?
> According to http://cran.at.r-project.org/ the version 2.0.1 is current.
> 
> Worth a mail to the maintainer of Rdbi/RdbiPgSQL.

Not really, 2.1.0 will be out soon, all it means is that the source 
package was built using 2.1.0 devel, usually meaning better sanity checks 
of the package code and documentation.

Roger

> 
> Markus
> 
> > Teague
> > 
> > 
> > 
> > 
> > Quoting Craig Aumann <caumann at ualberta.ca>:
> > 
> > > 
> > > 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
> > > 
> > > _______________________________________________
> > > statsgrass mailing list
> > > statsgrass at grass.itc.it
> > > http://grass.itc.it/mailman/listinfo/statsgrass
> > > 
> > 
> > 
> > 
> > Teague O'Mara
> > Department of Anthropology
> > Arizona State University
> > Box 872402
> > Tempe, AZ 85287-2402
> > 480.965.6213
> 
> 

-- 
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