powered by
with_message and with_warning add a warning or a message to a function. without_message and without_warning turn the warning and message off.
with_message
with_warning
without_message
without_warning
with_message(.f, msg)with_warning(.f, msg)without_message(.f)without_warning(.f)
with_warning(.f, msg)
without_message(.f)
without_warning(.f)
the function to wrap
the message to print
a function
# NOT RUN { msg_as_num <- with_message(as.numeric, msg = "Numeric conversion") warn_as_num <- with_warning(as.numeric, msg = "Numeric conversion") # }
Run the code above in your browser using DataLab