Skip to content

How to catch Error Messages in R

3 messages · guox at ucalgary.ca, Erik Iverson, Henrique Dallazuanna

#
As we knew, if a function is not used correctly,
an error message will throw/display in R:
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, how to catch error messages in R? Thanks,

-james
#
?try
guox at ucalgary.ca wrote: