[STATSGRASS] R, GRASS, and CYGWIN under version GRASS54

Roger Bivand Roger.Bivand at nhh.no
Thu Mar 17 16:36:45 EST 2005


On Fri, 18 Mar 2005, Redding, Matthew wrote:

> Hi All, 
> 
> Am I actually able to use R from within grass, in a windows (XP)
> R/cygwin grass install?
> 
> How do I kick it off?

Yes, Windows programs, like the versions of R compiled for Windows, can be 
run (or launched) from the prompt in a Cygwin terminal. For GRASS <= 
5.4.0, the R/GRASS interface works too, but needs some help to find where 
things are, see the GRASS.connect help page. For 6.0.0, the compiled 
interface is broken, and a new interpreted interface is growing on 
Sourceforge as spgrass6 under r-spatial.

Roger

> 
> 
> Thanks,
> 
> Matt Redding
> 
> -----Original Message-----
> From: statsgrass-admin at grass.itc.it
> [mailto:statsgrass-admin at grass.itc.it]On Behalf Of Redding, Matthew
> Sent: Friday, 11 March 2005 8:35 AM
> To: Roger.Bivand at nhh.no
> Cc: statsgrass at grass.itc.it
> Subject: RE: [STATSGRASS] R, GRASS, and CYGWIN under version GRASS54
> 
> 
> Hi Roger,
> 
> I agree, that was just an oversight.
> 
> The weird thing is, cygwin seems to habitually install so that my home directory is
> the n:/ drive.  So while that is not where the data is, it is where the .grassrc54 is.
> 
> But it does not seem to matter what I put in the cygwin string....your version works fine...
> What does it actually do?  Does the grass.connect(...) command over-ride it anyway?
> 
> This is the sequence I used to get things going:
> 
> > library(GRASS)
> Warning message: 
> package 'GRASS' was built under R version 2.0.1 
> > set.cygwinstring("c:/cygwin")
> [1] "c:/cygwin"
> > GRASS.connect(manual=TRUE, gisdbase="c:/cygwin/usr/local/share/grassdata"
> + , loc="Jack", mapset="PERMANENT")
> GRASS environment variables inserted manually
> NULL
> > G<-gmeta()
> > G
> $LOCATION
> [1] "Jack"
> ....
> 
> NOTE: I am NOT using R from within grass.  I am using R and accessing grass.  I am far more familliar wtih R than I am with grass,
> so that is just the way I ended up doing it.  In fact, I am not at all sure about how to run my normal R installation
> from with GRASS -- suggestions welcome.
> 
> 
> I used the system intensively yesterday with "set.cygwinstring("n:/")" 
> and found everything that I used worked well.  I used gmeta, sites.get, sites.put, and the equivalent raster commands.
> 
> It all worked very well!
> 
> Now, if I can run my windows R installation from within GRASS , I would like to learn that!
> 
> Thanks, 
> 
> Matt Redding
> 
> -----Original Message-----
> From: Roger Bivand [mailto:Roger.Bivand at nhh.no]
> Sent: Thursday, 10 March 2005 5:41 PM
> To: Redding, Matthew
> Cc: statsgrass at grass.itc.it
> Subject: RE: [STATSGRASS] R, GRASS, and CYGWIN under version GRASS54
> 
> 
> First - please always reply to the list on which you asked the question!!
> 
> If you do not, no-body else will share what you have learnt, nor will they
> be able to join in. It also makes the list archives useless, because they
> only contain open questions, not confirmations of resolution.
> 
> On Thu, 10 Mar 2005, Redding, Matthew wrote:
> 
> > Thanks Roger and Hamish, 
> > 
> > I think I am getting close to the real problem here.
> > When I start grass, I end up on my network drive n:...
> > and that is where the .grassrc54 is.
> > 
> > My grassdata directory is:
> > 
> > c:/cygwin/usr/local/share/grassdata.
> > 
> > so I did this:
> > 
> > set.cygwinstring("n:/")
> 
> I'm doubtful about this - from the above, the cygwin root is:
> 
> c:/cygwin
> 
> isn't it?
> 
> Please as far as possible copy the full console interaction - both your 
> commands, and what the system responds. Please remember that the list is
> not looking over your shoulder.
> 
> > 
> > I am not sure where the GISDBASE is.....
> > would it be in 
> > c:/cygwin/usr/local/share/grassdata ?
> > 
> > I suppose if that is the case, I need to then use something like:
> > 
> > GRASS.connect(manual=TRUE, gisdbase="c:/cygwin/usr/local/share/grasdata"
> > 	, loc="Jack", mapset="PERMANENT")
> > 
> 
> Well, what happened when you tried it? Please say more about what happens?
> What happens when you start GRASS - you are running R within GRASS, aren't
> you?
> 
> 
> 
> > 
> > Is that correct? Is that enought to get things fully operational?
> > 
> > I can now access data from the mapset listed.  So I have had derinate
> > progress.
> 
> That sounds positive. Please post a recipe of the steps you need, 
> preferably copy and paste from your console, than others can benefit from
> your learning too!
> 
> Best wishes,
> 
> Roger
> 
> > 
> > Thanks very much.
> > 
> > Thanks, 
> > 
> > Matt Redding
> > 
> > -----Original Message-----
> > From: statsgrass-admin at grass.itc.it
> > [mailto:statsgrass-admin at grass.itc.it]On Behalf Of Roger Bivand
> > Sent: Wednesday, 9 March 2005 5:28 PM
> > To: Redding, Matthew
> > Cc: statsgrass at grass.itc.it
> > Subject: Re: [STATSGRASS] R, GRASS, and CYGWIN under version GRASS54
> > 
> > 
> > On Wed, 9 Mar 2005, Redding, Matthew wrote:
> > 
> > > Hi GRASS and R Gurus, 
> > > 
> > > I sent an email on this subject prior to confirming my subscription to the group, so I hope no-one recieves this message twice.
> > > 
> > > I have had a look through the archive to see if GRASS54 will work under cygwin with R2.0.
> > > I notice that some people are using GRASS 54 with R, but the most recent mention of 
> > > using it with cygwin was back in 2002, and all the advice I have been able to find does not seem to work.
> > > 
> > > Will it actually work with my setup of R 2, GRASS 54 and cygwin?
> > > 
> > > Where should I look for info on how to get it all running?
> > > 
> > > The help material in R indicates a few suggestions, that do not seem to
> > > work for me.
> > > 
> > > For example, one of my problems is that I cannot find any file called
> > > .grassrc5 or anything much like it, as mentioned in the ?grass.connect()
> > > documentation under R.
> > 
> > Please try the following (based on the guess that the advice should have
> > said look for .grassrc5* - in 5.4 it is probably .grassrc54). From the
> > cygwin terminal prompt, start GRASS in text mode. Once you've chosen your
> > location and mapset, you get to the GRASS prompt. Try again to find your
> > .grassrc5* in your home directory (cat ~/.grassrc5*). If it is there, 
> > start R (either GUI or terminal), and library(GRASS), then 
> > set.cygwinstring(), or other routes to getting the cygwin prefix right.
> > 
> > I think your difficulty has been looking for .grassrc5 not .grassrc5* -
> > please let the list know if this helps. The general setup should work,
> > from reports from other users, you just need to get the specific naming
> > magic right for the cygwin prefix for the GISDBASE, I hope.
> > 
> > Roger
> > 
> > > 
> > > 
> > > Any suggestions on how to get it working?
> > > 
> > > Thanks, 
> > > 
> > > Matt Redding 
> > > 
> > > ********************************DISCLAIMER****************************
> > > The information contained in the above e-mail message or messages 
> > > (which includes any attachments) is confidential and may be legally 
> > > privileged.  It is intended only for the use of the person or entity
> > > to which it is addressed.  If you are not the addressee any form of 
> > > disclosure, copying, modification, distribution or any action taken 
> > > or omitted in reliance on the information is unauthorised.  Opinions
> > > contained in the message(s) do not necessarily reflect the opinions 
> > > of the Queensland Government and its authorities.  If you received 
> > > this communication in error, please notify the sender immediately and
> > > delete it from your computer system network. 
> > > 
> > > _______________________________________________
> > > 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