[GRASS-dev] (standalone/OSGeo4W)Wingrass-R-integration - which way to go?

Hi devs,

some time ago [1] I've integrated R-batch-files [2] into the GRASS GIS
source [3] for a nice WinGRASS-R-integration [4].

At the moment this functionality of a dynamic R-integration is only
available for standalone WinGRASS7svn, in standalone WinGRASS6.x a static
approach of a R-integration is implemented [5].

On the other hand regarding the OSGeo4W-environment, there isn't actually
any R-OSGeo4W-WinGRASS6.x/7.svn-integration.

As updating the R-batch-files is pending, there are now some ways to go:

(A) just update the R-batch-files in source of GRASS GIS 7.svn for
standalone WinGRASS 7.svn, staying with static approach of a R-integration
in standalone WinGRASS6.x, further no R-integration with OSGeo4W-WinGRASS6/7

(B) update the R-batch-files in the source of GRASS GIS 7.svn for standalone
WinGRASS 7.svn and integrate also the R-batch-files in standalone
WinGRASS6.x (it's already there in standalone WinGRASS6dev for a long time),
further no R-integration with OSGeo4W-WinGRASS6/7

(C) try to include the R-batch-files into OSGeo4W-environment as its own
package -> a R-GRASS-integration would be then possible for standalone
WinGRASS6/7 AND OSGeo4W-WinGRASS6/7

any opinions?

[1] http://courses.neteler.org/nice-new-wingrass-7-with-r-integration/
[2] http://code.google.com/p/batchfiles/
[3] http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/external
[4] http://grasswiki.osgeo.org/wiki/R_statistics#GRASS_7_Usage
[5]
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/mswindows/GRASS-Installer.nsi.tmpl#L206
   
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/mswindows/GRASS-Installer.nsi.tmpl#L688

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/standalone-OSGeo4W-Wingrass-R-integration-which-way-to-go-tp5127931.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

(C) try to include the R-batch-files into OSGeo4W-environment as its own

package -> a R-GRASS-

integration would be then possible for standalone WinGRASS6/7 AND
OSGeo4W-WinGRASS6/7

just forgotten to mention, with alternative (C) OSGeo4W and other projects
may benefit from a smooth R-integration too.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/standalone-OSGeo4W-Wingrass-R-integration-which-way-to-go-tp5127931p5127961.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

That will be great!
we do need grass able to talk with R also in osgeo4w.

do you have any experience in running rpy2 on windows and within the system python or with osgeo4w python ?

.. hope your solution will make this happening!

Massimo.

On Mar 9, 2014, at 5:57 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

(C) try to include the R-batch-files into OSGeo4W-environment as its own

package -> a R-GRASS-

integration would be then possible for standalone WinGRASS6/7 AND
OSGeo4W-WinGRASS6/7

just forgotten to mention, with alternative (C) OSGeo4W and other projects
may benefit from a smooth R-integration too.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/standalone-OSGeo4W-Wingrass-R-integration-which-way-to-go-tp5127931p5127961.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Massimo,

That will be great!
we do need grass able to talk with R also in osgeo4w.

unlike as rpy2 are R-python-bindings, the R-batchfiles simply enables
invoking R from anywhere you are, e.g. within a WinGRASS-session or within a
OSGeo4W-shell/commandline:

echo The script is self contained so just place it anywhere on your Windows
echo PATH. (From the Windows cmd line the command PATH shows your current
echo Windows path.) You may optionally make copies of this script with
names
echo like R.bat, Rscript.bat, Rcmd.bat so that each has a different default.

some ideas behind the R-batchfiles:
______________________________________________________________________________
echo (c) 2013 G. Grothendieck
echo License: GPL 2.0 ( http://www.gnu.org/licenses/gpl-2.0.html )
echo Launch script for R and associated functions.
echo Usage: R.bat [subcommand] [arguments]
echo Subcommands where (0) means takes no arguments; (A) means may need
Admin priv
echo cd - cd to R_ROOT, typically to C:\Program Files\R (0)
echo cmd - Run Rcmd.exe
echo dir - List contents of R_ROOT in chronological order showing R
versions (0)
echo gui - Run Rgui.exe
echo help - Help info (0)
echo path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line
session (0)
echo R - Run R.exe (0)
echo script - Run Rscript.exe
echo show - Show R_ variable values used. R_PATH, etc. (0)
echo SetReg - Run RSetReg; see 2.17 in R FAQ for Windows (A)
echo tools - Add R_TOOLS and R_MIKTEX to path for this cmd line session
(0)
echo touch - Change date on R_HOME to now (0) (A)
echo Examples
echo R -- invoke R.exe R gui -- invoke Rgui.exe
echo R dir -- show R versions R show -- show R_ variables
echo R CMD build mypkg -- builds mypkg
echo cmd /c set R_VER=R-2.14.0 ^& R gui -- run indicated Rgui version
echo cmd /c set R_ARCH=32 ^^^& R gui -- run 32 bit Rgui
echo cmd /c R_VER=R-2.14.0 ^^^& R setreg - make 2.14.0 current in registry
echo cmd /c R_VER=R-2.14.0 ^^^& R.bat touch - change date on R-2.14.0 dir
to now
[...]
______________________________________________________________________________

some examples from within the download folder here on my laptop

______________________________________________________________________________
C:\dl\batchfiles_0.7-1>R

R version 3.0.3 (2014-03-06) -- "Warm Puppy"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' für Details dazu.

R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
Tippen Sie 'contributors()' für mehr Information und 'citation()',
um zu erfahren, wie R oder R packages in Publikationen zitiert werden
können.

Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder
'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.

q()

Workspace sichern? [y/n/c]: n
C:\dl\batchfiles_0.7-1>
______________________________________________________________________________
C:\dl\batchfiles_0.7-1>R show
R_ARCH=x64
R_CMD=RShow
R_HOME=C:\Program Files\R\R-3.0.3
R_PATH=C:\Program Files\R\R-3.0.3\bin\x64
R_REGISTRY=1
R_ROOT=C:\Program Files\R
R_TOOLS_PATH={app}=
R_VER=R-3.0.3

______________________________________________________________________________
C:\dl\batchfiles_0.7-1>R dir
Volume in Laufwerk C: hat keine Bezeichnung.
Volumeseriennummer: 1490-7862

Verzeichnis von C:\Program Files\R

08.03.2014 22:15 <DIR> ..
08.03.2014 22:15 <DIR> .
08.03.2014 22:17 <DIR> R-3.0.3
______________________________________________________________________________

do you have any experience in running rpy2 on windows and within the system

python or with osgeo4w python ?

I've never had a closer look at rpy2 on windows. is a ready to use rpy2
available for windows.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/standalone-OSGeo4W-Wingrass-R-integration-which-way-to-go-tp5127931p5128030.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

hi,

That will be great!
we do need grass able to talk with R also in osgeo4w.

ok, I've testet a stripped down R-batch-file
<http://osgeo-org.1560.x6.nabble.com/file/n5128182/setR.bat&gt; and put it
into

C:\OSGeo4W\etc\ini

results:

- R (R and RGui) starts in 'OSGeo4W Shell' and 'OSGeo4W' (OSGeo4W command
shell)
- OSGeo4W-WinGRASS6.4.svn/6dev-wxGUI starts without any problem
- OSGeo4W-WinGRASS6.4.svn/6dev in text mode starts without any problem, R
and RGui is usable within the GRASS session

but

- OSGeo4W-WinGRASS7.svn-wxgui doesn't start
- OSGeo4W-WinGRASS7.svn in text mode doesn't start

any testing/ideas are welcome to push this forward and propose it for
including in OSGeo4W upstream.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/standalone-OSGeo4W-Wingrass-R-integration-which-way-to-go-tp5127931p5128182.html
Sent from the Grass - Dev mailing list archive at Nabble.com.