Re: [R] How to catch a R error in R code

2007-10-10 Thread Kuhn, Max
Howard, > though it received the statement. I tried to use some R built-in > functions of try, tryCatch, eval, expression, as.expression, > parse, deparse, etc. None of them worked. How did they not work? What did you attempt? Did you use silent = TRUE in try? Please be more specific about t

Re: [R] How to catch a R error in R code

2007-10-10 Thread jim holtman
You need to follow the posting guide and provide commented, minimal, self-contained, reproducible code. I can only guess at what your code looks like, but the following catches the error: > z <- try(eval(parse(text="1:20 <- x"))) Error in eval(expr, envir, enclos) : object "x" not found > str(z)

[R] How to catch a R error in R code

2007-10-10 Thread HU,ZHENGJUN
Hi All, I entered a R statement, e.g. 1:20 = x or log("a") on an HTML form and passed it to a R-CGI script. Obviously, neither of both is a correct R statement or expression. However, my R-CGI script could not return and report the error message to the Web site even though it received the st