<br><br><div class="gmail_quote">2011/7/20 Roger Bivand <span dir="ltr">&lt;<a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, 20 Jul 2011, Tim Besser wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear GRASS-community,<br>
<br>
I have a very strange problem. I wrote a script in R (2.10.1) for the preparation of my datasets which works fine on my laptop (winxp). I do not start my R session from GRASS but use GRASS through the initGRASS and execGRASS commands. I use the &quot;spgrass6&quot; package and GRASS 6.4.1. As the script would run for days on my old laptop I now got a remote desktop connection to a much faster computer at the university (win7). However, while cmds like r.reclass or r.in.gdal (execGRASS) work on that computer the r.patch (execGRASS) cmd produces following error:<br>

</blockquote>
<br></div>
Do not start R in GRASS using initGRASS when you are using an exiting location - I will most likely remove this possibility at the next release as it confuses users</blockquote><div><br></div><div>No - please don&#39;t. I am using it a lot, and it works very nicely (at least (and only?) for me?). And it makes live so much easier for me - I am running the simulations non-interactive on a cluster, and starting grass, which then starts R was always a hassle. </div>
<div><br></div><div>What about adding a new option (errorOnExistingLocation=TRUE), which raises an error when the location exists? </div><div><br></div><div>I assume that quite a few users are using R as a scripting language, and in this case, and consequently is more logical to me to have R as the base, which then initializes the grass environment when I need it, and not that I have to decide before I start R, if I have to start R in grass.</div>
<div><br></div><div>I must admit, I am not to clear why it can be a problem when using initGRASS for an existing location (I know you explained it already, but I must have missed something). </div><div><br></div><div>I remember reading that somebody was putting all the gras environmental variable initialization into .bash so that he/she can use grass from any terminal - so just setting the variables should be enough, if one is careful not to work in the same location from two different shells (i.e. grass sessions). </div>
<div><br></div><div>So there are effectively two aspects of interfacing GRASS with R:</div><div><br></div><div>1) analysing spatial data which *is in R* with GRASS</div><div>2) analysing spatial data which *is in a GRASS database* with R</div>
<div><br></div><div>I am using a mix of 1 and 2: my data comes from R and (mainly) a GRASS database, is processed in R and GRASS, and results are stored in the GRASS database.</div><div><br></div><div>As the name of the location is determined in the parameter file (which is loaded into the R session), to go back to R inside grass would make things considerably more complex.</div>
<div><br></div><div>By the way - how is python handling the link to GRASS? As I never used python, I have no idea how this works. </div><div><br></div><div>Hope I will be able to convince you to leave the possibility in spgrass6,</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Rainer</div><div><br></div><div> ...SNIP...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Roger<div><div></div>
<div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
execGRASS(&quot;r.patch&quot;, flags=c(&quot;z&quot;), parameters=list(input=&quot;<u></u>mangroves_1989_138_044_LR_<u></u>recl,mangroves_1989_138_045_<u></u>UL_recl,mangroves_1989_138_<u></u>045_UR_recl&quot;, output=&quot;testomat&quot;), intern=T)<br>

<br>
Error in system(cmd0, intern = TRUE) :<br>
 Createprocess konnte &#39;C:\GRASS6~1.1\bin\RPATCH~1.<u></u>EXE --interface-description&#39; nicht ausführen<br>
Fehler in parseGRASS(cmd) : r.patch not found<br>
<br>
I checked the GRASS directory and it is set right in the initGRASS command.<br>
<br>
I hope you can help me with one. I have no clue what to do!<br>
<br>
Thanks in advance,<br>
<br>
Tim<br>
<br>
______________________________<u></u>_________________<br>
grass-stats mailing list<br>
<a href="mailto:grass-stats@lists.osgeo.org" target="_blank">grass-stats@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-stats" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/grass-stats</a><br>
<br>
</blockquote>
<br></div></div><font color="#888888">
-- <br>
Roger Bivand<br>
Department of Economics, NHH Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: <a href="tel:%2B47%2055%2095%2093%2055" value="+4755959355" target="_blank">+47 55 95 93 55</a>; fax <a href="tel:%2B47%2055%2095%2095%2043" value="+4755959543" target="_blank">+47 55 95 95 43</a><br>
e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a></font><br>_______________________________________________<br>
grass-stats mailing list<br>
<a href="mailto:grass-stats@lists.osgeo.org">grass-stats@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-stats" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-stats</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)<br><br>Centre of Excellence for Invasion Biology<br>Stellenbosch University<br>
South Africa<br><br>Tel :       +33 - (0)9 53 10 27 44<br>Cell:       +33 - (0)6 85 62 59 98<br>Fax (F):       +33 - (0)9 58 10 27 44<br><br>Fax (D):    +49 - (0)3 21 21 25 22 44<br><br>email:      <a href="mailto:Rainer@krugs.de" target="_blank">Rainer@krugs.de</a><br>
<br>Skype:      RMkrug<br><br>