50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


attempt (version 0.3.1)

with_message: Manipulate messages and warnings

Description

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.

Usage

with_message(.f, msg)

with_warning(.f, msg)

without_message(.f)

without_warning(.f)

Arguments

.f

the function to wrap

msg

the message to print

Value

a function

Examples

Run this code
# 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