Re: [R] How to catch Error Messages in R

2010-05-27 Thread Henrique Dallazuanna
Try this: x <- tryCatch(rnorm(-1), error = c) On Thu, May 27, 2010 at 5:25 PM, wrote: > As we knew, if a function is not used correctly, > an error message will throw/display in R: > > > rnorm(-1) > Error in rnorm(-1) : invalid arguments > > I would like to catch the error message or assign an

Re: [R] How to catch Error Messages in R

2010-05-27 Thread Erik Iverson
?try g...@ucalgary.ca wrote: As we knew, if a function is not used correctly, an error message will throw/display in R: rnorm(-1) Error in rnorm(-1) : invalid arguments I would like to catch the error message or assign an error message to a variable so that I can use them some where else. So