<br><br><div><span class="gmail_quote">On 27/02/2008, <b class="gmail_sendername">Glynn Clements</b> <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>> 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> > Sorry for crossposting, but I think this can be of interest for GRASS and R<br> > users.<br> ><br> > I am planning to write a package to make the use of GRASS from R easier. The<br>
> idea is to wrap the system call to execute the GRASS command into an R<br> > command of the same name.<br> > e.g:<br> > r.to.vect <- function(..., intern=TRUE, ignore.stderr=FALSE)<br> > {<br> > comm <- paste( "r.to.vect ", ..., sep="" )<br>
> print(comm)<br> > system( comm, intern=intern, ignore.stderr=ignore.stderr )<br> > }<br> ><br> > My questions are:<br> ><br> > 1) Is this a good way of doing it, or is giving a named list to the function<br>
> 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;">
> 2) Is there a way to obtain easily all commands from GRASS and the<br> > 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'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 ' I will look at them and come back if I don't understand them.<br><br>Thanks<br><br>Rainer<br> <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 <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><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