[R] Help with tryCatch

eric ericstrom at aol.com
Sun Jul 10 18:25:01 CEST 2011

Having a hard time understanding the help files for tryCatch. Looking for a
little help with the following statement which sits inside a for loop

zest[i] <- tryCatch(sapply(getNodeSet(zdoc, "//zestimate/amount"),
xmlValue), error=function() zest[i] <-"NA")

zest is a numeric vector

If the sapply statement evaluates to an error, I'd like to set the value of
zest[i] to NA and continue with the loop.

Suggestions ?

View this message in context: http://r.789695.n4.nabble.com/Help-with-tryCatch-tp3657859p3657859.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list