[R] Fwd: Trycatch in R

Archit Soni soni.archit1989 at gmail.com
Wed Dec 23 11:46:29 CET 2015

Hi All,

I didn't receive a mail from moderator that my post is pending for review,
hence sending once again.

Please suggest, I got answer from Stack overflow but somehow couldn't get
it implemented, if anyone of you can suggest how try catch can be
implemented in this case.

Thanks again!

Best Regards,
---------- Forwarded message ----------
From: Archit Soni <soni.archit1989 at gmail.com>
Date: Tue, Dec 22, 2015 at 6:34 AM
Subject: Trycatch in R
To: r-help at r-project.org

Hi All,

Please help me in the below code:

 x <- capture.output(XML::xmlParse(y))
}, warning = function(w) {
  x <- capture.output(w)
}, error = function(e) {
  x <-capture.output(e)
}, finally = {


I am using Tibco Enterprise Runtime for R to get value of the parsed XML in
vector format, and spotfire is displaying each line as a row in new table,
but can you please suggest how to do error handling in this case when no
row is selected and we run this script, it is throwing error for length of
argument is 0, i need to display an error message as first row of the table.

Please suggest.



	[[alternative HTML version deleted]]

More information about the R-help mailing list