[R] try catch block

ppatel3026
Tue, 17 Jun 2008 21:15:43 -0000

How can I use the try catch block such that if this statement fails
xml <- xmlTreeParse(xmlTxt, useInternal=TRUE)

then this statement is executed

xml <- xmlMalFormed()

?

This code does not work but assuming its somewhere along these lines:
tryCatch(xml <- xmlTreeParse(xmlTxt, useInternal=TRUE), xml <-
xmlMalFormed(f1))


--
View this message in context:
http://www.nabble.com/try-catch-block-tp17938467p17938467.html
Sent from the R help mailing list archive at Nabble.com.