[R-sig-Geo] warnings and errors from grass to R via spgrass6

Rainer M. Krug Rainer at krugs.de
Tue Apr 16 17:02:14 CEST 2013


Hi

I am using spgrass6 with grass 7 and can report that it works so far
without problems.

Nevertheless, I have one question, which I already had about grass 6.

I am using execGRASS to execute grass commands as well as an own defined
function r.mapcalc [1].

Now as these are used in a simulation script, I would like to (actually
need to know) when these functions fail. 

Is there a way that errors and warnings in GRASS will be reflected as
errors and warnings in R when tthe grass function is called via execGRASS?

I am using Linux and R 3.0.0

Thanks,

Rainer


Footnotes: 
[1] r.mapcalc is defined as follow:
--8<---------------cut here---------------start------------->8---
 r.mapcalc <- function(
    ...,
    intern = TRUE,
    ignore.stderr = !options("asmDebug")[[1]],
    feedback = TRUE,
    flags = NULL
    ) {
    comm <- paste( "r.mapcalc ", " \"", ..., "\" ", sep="" )
    if (!is.null(flags)) {
      flags <- paste0("--", flags, collapse=" ")
    }
    comm <- paste(comm, flags)
    if (feedback) print(comm)
    system( comm, intern=intern, ignore.stderr=ignore.stderr )
  }
--8<---------------cut here---------------end--------------->8---

  



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130416/05444e4c/attachment.bin>


More information about the R-sig-Geo mailing list