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

Roger Bivand Roger.Bivand at nhh.no
Wed Jan 13 05:42:41 PST 2016


On Wed, 13 Jan 2016, Helmut Kudrnovsky wrote:

>> http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip
>>
>> Could users of initGRASS() please check that the environment variables are
>> set correctly for addons? 
>
>> sessionInfo()
> R version 3.2.3 (2015-12-10)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> locale:
> [1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252 
> LC_MONETARY=German_Austria.1252 LC_NUMERIC=C 
> [5] LC_TIME=German_Austria.1252 
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base 
>
> other attached packages:
> [1] rgrass7_0.1-5 XML_3.98-1.3  sp_1.2-2 
>
> loaded via a namespace (and not attached):
> [1] grid_3.2.3      lattice_0.20-33
>
>> library(rgrass7)
> Lade nötiges Paket: sp
> Lade nötiges Paket: XML
> GRASS GIS interface loaded with GRASS version: (GRASS not running)
>
>> 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 
>
>> execGRASS("g.region", raster="elevation", align="elevation", flags="a")
>
>> execGRASS("r.slope.aspect", elevation="elevation", slope="myslope",
>> aspect="myaspect")
>
> Expositions-Rasterkarte <myaspect> komplett.
> Neigungs-Rasterkarte <myslope> komplett.
>> execGRASS("r.roughness.vector", elevation="elevation", slope="myslope",
>> aspect="myaspect", strength="vectorstrength")
> ----
> Check if input files exist ...
> ----
> Define default output names when not defined by user ...
> ----
> Calculate compass aspect values ...
> ----
> Calculate colatitude ...
> ----
> Calculate direction cosines ...
> ----
> Calculate sum of direction cosines ...
> Calculating sum of X direction cosines ...
>
> Calculating sum of Y direction cosines ...
>
> Calculating sum of Z direction cosines ...
>
> ----
> Calculate vector strength ...
> ----
> Calculate inverted Fisher's K parameter ...
> ----
> Result maps:
> vectorstrength
> elevation_fisher_1K_3x3
> Calculations done.
> ----
>
>> execGRASS("r.reclass.area", input="zipcodes",
>> output="zipcode_larger2000ha", value=2000, mode="greater")
> Generating a clumped raster file ...
> Pass 1 of 2...
>
> Generating renumbering scheme...
>
> Pass 2 of 2...
>
> r.clump komplett. 16 clumps.
> Generating a reclass map with area size greater than or equal to
> 2000.000000 hectares...
>
> Generating output raster map <zipcode_larger2000ha>...
>> 
>
> it seems to work properly in:
>
> R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> thanks!
>

Thanks very much for checking! Could someone please report on status for 
OSX, and corroborate my finding that it works for my source installed 
GRASS on Fedora - other Linux variants and installation mechanisms (Ubuntu 
etc. installed binary?? may vary.

Best wishes,

Roger

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

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412


More information about the grass-stats mailing list