2

I am trying to run GRASS GIS version 7.0.3 from R version 3.2.3 using Windows 7. I installed the R package rgrass7 (which provides the interface between GRASS GIS 7 and R) from the CRAN repository. In R running as Administrator, I tried to initialize GRASS GIS like this (after loading rgrass7 library):

initGRASS("C:/OSGeo4W64/apps/grass/grass-7.0.3", d, override = TRUE)

This is the correct path for my system and I have also added following paths of GRASS GIS and R in windows system path:

C:\OSGeo4W64\apps\grass\grass-7.0.3
C\Program Files\R-3.2.3\bin

I am getting following error:

Error in system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("WINGISRC"))), : 'g.dirseps.exe' not found Called from: system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("WINGISRC"))), intern = TRUE)

Can any one help me find out what is wrong in the path or any other relevant ambiguity?

lmo
  • 37,904
  • 9
  • 56
  • 69
khajlk
  • 791
  • 1
  • 12
  • 32
  • What if you just do `initGRASS("C:/OSGeo4W64/apps/grass/grass-7.0.3")`? (That's what I just tried, and it seems to work here with GRASS GIS 7.01 on Windows 7.) – lukeA Mar 30 '16 at 12:02
  • Thank you for your feedback. I just tried initGRASS("C:/OSGeo4W64/apps/grass/grass-7.0.3") and still the same error. – khajlk Mar 30 '16 at 13:13
  • I assume `g.dirseps.exe` is available in the bin folder? Before running `initGRASS`, `grep("grass", strsplit(Sys.getenv("PATH"), ";", T)[[1]], ig=T, val=T)` is empty here (no PATH environment set); afterwards it has `C:\Program Files (x86)\GRASS GIS 7.0.1\bin;C:\Program Files (x86)\GRASS GIS 7.0.1\lib;C:\Program Files (x86)\GRASS GIS 7.0.1\tcl-tk\bin;C:\Program Files (x86)\GRASS GIS 7.0.1\sqlite\bin;C:\Program Files (x86)\GRASS GIS 7.0.1\gpsbabel;C:\Program Files (x86)\GRASS GIS 7.0.1\extrabin;C:\Program Files (x86)\GRASS GIS 7.0.1\extralib;C:\Program Files (x86)\GRASS GIS 7.0.1\msys\bin`. – lukeA Mar 30 '16 at 14:46
  • Is there something wrong related to the version of R? because when I load rgrass7 library in R, it shows some messages for R ver. 3.2.4 and I am using R ver. 3.2.3. Secondly, I just checked the bin directory of R and could not find g.dirseps.exe. Strange! You think this is the root of the problem? I am not sure whether I should add these paths of GRASS GIS in my system as well. I could give it a try as well. – khajlk Mar 30 '16 at 15:06
  • `g.dirseps.exe` is in the Grass bin dir. – lukeA Mar 30 '16 at 15:48
  • Where is your GRASS installed? (Is the path `C:/OSGeo4W64/.../grass-7.0.3` correct?) Also, it might be better to ask this question at http://gis.stackexchange.com. – wenzeslaus Mar 31 '16 at 13:40

0 Answers0