[R-sig-Geo] flags in execGRASS

Roger Bivand Roger.Bivand at nhh.no
Thu Nov 19 19:34:50 CET 2009


On Thu, 19 Nov 2009, Agustin Lobo wrote:

> Hi!
> The following works:
>> 
> doGRASS("r.grow.distance",flags=c("overwrite"),parameters=list(distance="dummyd",input="dummy"))
> [1] "r.grow.distance --overwrite distance=dummyd input=dummy"
>
> But using "o" instead of "overwrite" does not

Because only "overwrite" is included in

r.grow.distance --interface-description

and that is what the flags are checked against. Unfortunately, many XML 
descriptions are more demanding than the help pages, but for parseGRASS() 
to work, it must use the self-definition without exception. execGRASS() is 
designed for scripting, in which case keeping to tighter limits than the 
help pages is OK. Some commands have both "o" and "overwrite" for 
different things too, so confusion would ensue.

Roger

>> 
> doGRASS("r.grow.distance",flags=c("o"),parameters=list(distance="dummyd",input="dummy"))
> Error in doGRASS("r.grow.distance", flags = c("o"), parameters = 
> list(distance = "dummyd",  :
>  Invalid flag value: o
>
> despite the fact that the grass manual states:
>> r.grow.distance --help
> ...(stuff deleted)
>
> Usage:
> r.grow.distance input=name [distance=name] [value=name]
>   [metric=string] [--overwrite] [--verbose] [--quiet]
>
> Flags:
> --o   Allow output files to overwrite existing files
> --v   Verbose module output
> --q   Quiet module output
> ...(stuff deleted)
>
> Could it be possible that execGRASS accept both forms for consistency with 
> the grass command? If this is not possible or appropriate, could a note be 
> added to the execGRASS manual page?
>
> Thanks
>
> Agus
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list