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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to