[GRASS-dev] R and GRASS integration

Moritz Lennert mlennert at club.worldonline.be
Mon Jan 4 01:28:06 PST 2016


On 03/01/16 23:54, Steven Pawley wrote:
> Like many R-GRASS users, I have a collection of R scripts that
> interact with GRASS to perform various workflows. I have debated
> about converting these to Python using Rpy2, although this package
> can be a difficult to install on all platforms and depends on
> specific versions of R and Python. I noticed that Moritz Lennert
> recently developed a GRASS add on which consists of simply writing
> out the R commands to a temporary script for R to run.

[...]
>
> Does this represent a desirable or even acceptable approach for
> embedding R scripts into grass add ons, or is Rpy2 the 'official'
> approach.

I wouldn't consider my approach in any way official, but AFAIK, rpy2 
does not have any "official" status in GRASS either. In my particular 
case (v.class.mlR) this was a quick and dirty hack for a course I had to 
teach. The difficulty of getting rpy2 installed on the lab machines on 
short notice was one of the motivations not to use it. I also agree that 
dependency on rpy2 can be a nuisance and has caused me some headaches 
with other modules, before. However, the approach I used (and others 
have used before) is a bit unwieldy and makes maintaining such modules a 
bit of a pain.

So, I'm curious to hear the opinions of others...

Moritz


More information about the grass-dev mailing list