How to Apply the message(), warning() & stop() Functions in R (Example Code)
In this R programming tutorial you’ll learn how to apply the message, warning, and stop functions.
Example: message() vs. warning() vs. stop() Function in R
my_message <- "I have an important message for you!!!" |
my_message <- "I have an important message for you!!!"
message(my_message) # Applying message function in R # I have an important message for you!!! |
message(my_message) # Applying message function in R # I have an important message for you!!!
warning(my_message) # Applying warning function in R # Warning message: # I have an important message for you!!! |
warning(my_message) # Applying warning function in R # Warning message: # I have an important message for you!!!
stop(my_message) # Applying stop function in R # Error: I have an important message for you!!! |
stop(my_message) # Applying stop function in R # Error: I have an important message for you!!!