[R-sig-Geo] Trouble with Grass 6.4.2 and R 2.14.1 interface

Roger Bivand Roger.Bivand at nhh.no
Sat Jan 14 10:03:36 CET 2012


On Fri, 13 Jan 2012, Laura S wrote:

> Dear all:
>
> I am trying to get R to run with grass, but I am running into trouble.
>
>
> This is what I have done so far:
>
> Installed GRASS 6.4.2 for Windows XP
> Installed spgrass6 with dependencies.
>
> When I do:
> library(spgrass6)
> gmeta6()
>
> I get the following:
> Error in system(cmd0,intern=TRUE); "g.region.exe' not found
> Error in parseGRASS(cmd) : g.region not found.
>
> Any suggestions are much appreciated. I am new to using GRASS with R, 
> but I am looking forward to using them together to analyze data.
>
> I am unsure which terminal to run R in GRASS because I keep getting 
> errors in the command console in GRASS: I type into either "Command 
> console in GRASS GIS Layer Manager" OR "GRASS Command Line":
>
> R
> ...Then I get
>
> 'R' is not recognized as an internal or external command, operable 
> program or batch file.

This suggests that you need to give the complete path to R from within 
your GRASS session. It may be "C:/Program Files/R/R-2.14.1/bin/Rgui.exe" 
or something like that, depending on where you installed it. You may also 
need to add R_LIBS="<whatever>" to this, to show where any local libraries 
may be.

Alternatively, you may try to add R's binary location to your PATH 
environment variable, and declare R_LIBS globally; these used to be under 
advanced system properties.

Finally, as Rainer suggests, you may start GRASS from within R, using the 
same logic in reverse, giving the full path to the GRASS install location 
to the initGRASS() function. The key in both cases is to find out where in 
your file system the software components live, and note changes when you 
upgrade.

Hope this helps,

Roger

>
>
> Thank you
>
> Laura
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list