<br><br><div><span class="gmail_quote">On 27/02/2008, <b class="gmail_sendername">Glynn Clements</b> &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> Rainer M Krug wrote:<br> <br> &gt; Sorry for crossposting, but I think this can be of interest for GRASS and R<br> &gt; users.<br> &gt;<br> &gt; I am planning to write a package to make the use of GRASS from R easier. The<br>
 &gt; idea is to wrap the system call to execute the GRASS command into an R<br> &gt; command of the same name.<br> &gt; e.g:<br> &gt; r.to.vect &lt;- function(..., intern=TRUE, ignore.stderr=FALSE)<br> &gt;&nbsp;&nbsp; {<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp; comm &lt;- paste( &quot;r.to.vect &quot;, ..., sep=&quot;&quot; )<br>
 &gt;&nbsp;&nbsp;&nbsp;&nbsp; print(comm)<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp; system( comm, intern=intern, ignore.stderr=ignore.stderr )<br> &gt;&nbsp;&nbsp; }<br> &gt;<br> &gt; My questions are:<br> &gt;<br> &gt; 1) Is this a good way of doing it, or is giving a named list to the function<br>
 &gt; more usefull?<br> <br> <br>If R provides a way to pass individual arguments (argc/argv), use that<br> instead of contructing a shell command as a string. Otherwise, you are<br> likely to run into problems with shell metacharacters in argument<br>
 values.</blockquote><div><br>I will lookm at that - because I already had the problems. And I would like to avoid them in the future! <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 &gt; 2) Is there a way to obtain easily all commands from GRASS and the<br> &gt; parameters possible and required?<br> <br>You can obtain a list of commands by enumerating the $GISBASE/bin and<br> $GISBASE/scripts directories. Nearly all commands support the<br>
 --interface-description switch, which outputs details of all of the<br> options in XML. There are several other switches which output the same</blockquote><div><br>That looks very good. I&#39;ll look into that. <br></div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> information in different formats; see the g.parser manpage for<br> details.</blockquote>
<div><br>Thanks for your toips &#39; I will&nbsp; look at them and come back if I don&#39;t understand them.<br><br>Thanks<br><br>Rainer<br>&nbsp;<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 --<br> Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt;<br> </blockquote></div><br><br clear="all"><br>-- <br><br>-- <br>Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT)<br>
<br>Plant Conservation Unit Department of Botany<br>University of Cape Town<br>Rondebosch 7701<br>South Africa