[GRASS-user] R and GRASS

Ahmadou Dicko dicko.ahmadou at gmail.com
Tue Apr 2 02:18:41 PDT 2013


As I told you before, I use GRASS 7 that's why I can use wxPython GUI  and
monitor (hence 'wx0').
In GRASS 6.4.3 I think that the name of the monitor are somewhat different.
I'm not sure but I think you'll need something like this :

execGRASS("d.mon", start = "x0")




On Tue, Apr 2, 2013 at 8:59 AM, matthias lauber <kamallauber at gmx.de> wrote:

> Hey,
>
> first: Thanks for the quick answer! My OS would be windows 7 Enterprise,
> SP1.
> It did however not work for me, because d.mon is not implemented in the
> GRASS Version 6.4.2 GUI,which I use, and when I try to start the command
> through R I get this:
>
> > execGRASS("d.mon", start = "wx0")
> FEHLER: no such monitor 'wx0'
> FEHLER: Es gibt das Grafikfenster <wx0> nicht.
> FEHLER: Es gibt das Grafikfenster <wx0> nicht.
> Probleme beim Auswählen von wx0. Einmal versuche ich es noch...Warnmeldung:Ausführung von Kommando 'd.mon.exe start=wx0' ergab Status 1
>
>
> which kind of translates to:
> ERROR: there is no graphic window <wx0>.
>  ERROR: there is no graphic window <wx0>.
>  Problems chosing wx0. I will try once more...
> Warnin:
> Execution of command'd.mon.exe start=wx0'returned Status 1
>
>
> Using the other commant anyway then gives:
>
> > execGRASS("d.vect", parameters=list(map="due"),intern=T)
> [1] "PNG: GRASS_TRUECOLOR status: TRUE" "PNG: collecting to file: map.png,"
> [3] "GRASS_WIDTH=782, GRASS_HEIGHT=502"
>
>  which is the same as before.
>
> I took the shape-files from here:
> http://www.ing.unitn.it/~grass/docs/tutorial_62_en/htdocs/esercitazione/geoprocessing/node1.html
> but it does not really matter since the vector map itself is not
> important... i simply want it to be added to the location manager...
>
> Is it good to send this reply to you only or should I, again, send it to
> the Mailing List in general? (my first question here..)
>
> Greets,
> Matthias
>
>  *Gesendet:* Dienstag, 02. April 2013 um 10:33 Uhr
> *Von:* "Ahmadou Dicko" <dicko.ahmadou at gmail.com>
> *An:* "matthias lauber" <kamallauber at gmx.de>
> *Betreff:* Re: [GRASS-user] R and GRASS
>    Hi,
>
> More info will be great for example. Which version of GRASS do you use and
> in which OS.
> Using GRASS 7, I proceed like this :
>
> 1 - launch GRASS on the appropriate location/mapset
> 2 - launch R inside GRASS
> 3-  in R do :
>  require(spgrass6)
> ## open a window to plot first
> execGRASS("d.mon", start = "wx0")
> execGRASS("d.vect", map="due")
>
> uname -a : Linux dickoa 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64
> GNU/Linux
> GRASS version : GRASS 7.0.svn (2013)
> R version : R version 3.0.0 RC (2013-03-30 r62448)
> packageVersion("spgrass6")
> [1] ‘0.7.15’
>
>
> Hope this help
>
>
> On Tue, Apr 2, 2013 at 7:36 AM, matthias lauber <kamallauber at gmx.de>wrote:
>>
>>  Hey folks,
>>
>> I am somewhat new to GRASS and I am trying to get GRASS to talk with R in
>> the way i want it to.
>> I am using the GRASS Version 6.4.2 and R 2.15.3 with RStudio.
>>
>> My question is, how I can use execGRASS() from spgrass6 to do EXACTLY
>> what GRASS would do?
>> When I try to simply display a vector-map like
>> library(spgarss6)
>> execGRASS("d.vect", parameters=list(map="due"),intern=T)
>>
>> it does not show add the vector map to my map-window but produces a
>> .png-file... Any ideas?
>>
>> Thank you in advance and happy after-easter,
>> Matthias
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>
>
>
>
> --
> Ahmadou H. DICKO
> Data scientist and applied economist
> PhD student in Climate change economics
> Faculty of economics and managment - Cheikh Anta Diop University
> West African Science Service Center on Climate Change and Adaptated Land
> Use (WASCAL)
> Center for Development Research (ZEF) - University of Bonn
> twitter : @dickoah
> github : github/dickoa
> tel : +221 33 827 55 16
> portable: +221 77 123 81 69
>



-- 
Ahmadou H. DICKO
Data scientist and applied economist
PhD student in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
twitter : @dickoah
github : github/dickoa
tel : +221 33 827 55 16
portable: +221 77 123 81 69
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? nettoy?e...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130402/004c6554/attachment.html>


More information about the grass-user mailing list