Hi!

I'm starting to work with R and grass through spgrass6 and have some
difficulties. I use Windows7 and grass from QGIS 1.7. I set up my location
and mapset and I start up R
with the command
xxxxxxxxxx
from within the grass console, after having done cd to my R working
directory.

R starts up normally and I get my workspace loaded.
 Then I do:
require(rgdal)
require(spgrass6)
initGRASS(gisBase= "C:/Program Files (x86)/Quantum GIS
Wroclaw/apps/grass/grass-6.4.1/bin", home=tempdir(),
gisDbase="D:/GRASSDATA", location= "MNSY", mapset="ALL", override = T,
use_g.dirseps.exe = FALSE)

and get this message at the R console:

 Error in system(cmd0, intern = TRUE) : 'g.region.exe' not found
In addition: Warning messages:
1: In dir.create(gisDbase) : 'D:\GRASSDATA' already exists
2: In dir.create(gisDbase) :
  cannot create dir 'D:\GRASSDATA', reason 'No error'
3: In dir.create(loc_path) : 'D:\GRASSDATA\MNSY' already exists
4: In dir.create(loc_path) :
  cannot create dir 'D:\GRASSDATA\MNSY', reason 'No error'
Error in parseGRASS(cmd) : g.region not found


Then I do
gmeta6()

Error in system(cmd0, intern = TRUE) : 'g.region.exe' not found
Error in parseGRASS(cmd) : g.region not found
which is correct.

But unfortunately, grass commands do not work:

system("g.region -p", intern=T)
Error in system("g.region -p", intern = T) : 'g.region' not found

execGRASS("g.region -p")
Error in system(cmd0, intern = TRUE) : 'g.region' not found
Error in parseGRASS(cmd) : g.region -p not found



R version 2.13.0 (2011-04-13)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252
 LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
LC_TIME=Spanish_Spain.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Any help with these errors? The equivalent procedure works under linux (but
I do not have linux myself).
Also, is it necessary/convenient starting R from the grass console as I do
or is there a better way to start grass from within R?

Thanks!

*CRISTINA*

	[[alternative HTML version deleted]]

