print_and_capture {assertive.base} | R Documentation |
Prints a variable and captures the output, collapsing the value to a single string.
print_and_capture(x, ...)
x |
A variable. |
... |
Arguments passed to |
A string.
# This is useful for including data frames in warnings or errors message("This is the sleep dataset:\n", print_and_capture(sleep))