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!!!"
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!!!
stop(my_message)           # Applying stop function in R
# Error: I have an important message for you!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top