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)