How to return a error message in R?

How to return a error message in R?

Since you dont specify what you really want, all I just can say is take a look at

?message # prints a message but not stop execution
?warning # prints a warning message but not stop execution
?stop # stops execution of the current expression and executes an error action.

Simply include stop() inside your function/script

If youd like an error message, include it inside stop() like so

stop(This is an error message)

How to return a error message in R?

Leave a Reply

Your email address will not be published.