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

Rainer M Krug r.m.krug at gmail.com
Sat Jan 14 09:56:42 CET 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14/01/12 03:48, Laura S wrote:
> Dear all:
> 
> I am trying to get R to run with grass, but I am running into
> trouble.

A very useful combo - and usually works nicely.

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

Under Linux (I know - you use Windows), you have to start GRASS and
then, from the GRASS console, start R. The reason is, that some
environmental variables need to be set for identifying the grass
database, location, mapset etc.

Something similar needs to be doe under Windows as well - so check
again in the manual or google, and you should find the right procedure
under Windows.

The other approach is to use initGRASS(), but Roger Bivand discourages
this if you want to access existing data in GRASS (although I use it
all the time and it works nicely).

But it seems to be, that under windows, the easiest way is to use
initGRASS(): see http://grass.osgeo.org/wiki/R_statistics

Hope this helps and enjoy this very powerful combo,

Rainer


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


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8RQ0oACgkQoYgNqgF2egqRSgCfV1LLIXXpqv6HPaPWPyvFVs4X
LAYAnAo6M5KzdAC/aIuLa5vpetUW6oS7
=gea0
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list