[GRASS-stats] Using GRASS addons in R on Windows

Helmut Kudrnovsky hellik at web.de
Wed Jan 13 04:56:21 PST 2016


>Thanks. I've committed changes to R-forge, which seem to work for me for
>Linux and Windows. The updated draft Windows binary is at:
>
>http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip

> utils:::menuInstallLocal()
Paket ‘rgrass7’ erfolgreich ausgepackt und MD5 Summen abgeglichen
> 
> library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

from the https://cran.r-project.org/web/packages/rgrass7/rgrass7.pdf

Examples
## Not run:
initGRASS("/usr/bin/grass-7.0.0", home=tempdir())
initGRASS("C:/GRASS", home=tempdir())
## End(Not run)

as an used windows user I've tried first with Windows-typical backslash ;-)

initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(),
gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:\Program Files\GRASS GIS 7.1.svn", home=tempdir(),
> location="C:\grassdata\nc_spm_08\", mapset="user1")
Fehler: '\P' ist eine unbekannte Escape-Sequenz in der Zeichenkette
beginnend mit ""C:\P"
error: '\P' is an unkown escape sequence beginning with with ""C:\P"

then I tried double backslash

initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(),
gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(),
> gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata 
location    nc_spm_08 
mapset      user1 
rows        6 
columns     8 
north       222800 
south       222740 
west        642590 
east        642670 
nsres       10 
ewres       10 
projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1 

and the slash mentioned in the manual example

initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(),
gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(),
> gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata 
location    nc_spm_08 
mapset      user1 
rows        6 
columns     8 
north       222800 
south       222740 
west        642590 
east        642670 
nsres       10 
ewres       10 
projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1 

not sure what R's normal notation of MS windows paths are (slash or double
backslash), maybe an addition to the manual would be worth?

will testing winGRASS modules and addons later.



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-GRASS-addons-in-R-on-Windows-tp5244411p5244980.html
Sent from the Grass - Stats mailing list archive at Nabble.com.


More information about the grass-stats mailing list