Skip to content

execGRASS() for r.mapcalc?

2 messages · Agustin Lobo, Roger Bivand

#
I'm used to do:
 > cmd = "r.mapcalc 'delme=100'"
 > system(cmd)

and works, but how could I do the equivalent using execGRASS() ?
I've tried:

 > doGRASS(cmd)
Error in parseGRASS(cmd) : r.mapcalc 'delme=100' not parsed

 > execGRASS(cmd)
Error in parseGRASS(cmd) : r.mapcalc 'delme=100' not parsed

I can always use paste() to make any cmd string, but seems to me that 
execGRASS() would be cleaner.

Thanks

Agus
#
On Thu, 19 Nov 2009, Agustin Lobo wrote:

            
You cannot. r.mapcalc does not provide an --interface-description XML 
self-definition. You have either to use system() as before (with different 
quoting reimes for different OS), or r.mapcalculator in execGRASS(). This 
problem is shared with other interfaces using --interface-description.

Roger