print_and_capture {assertive.base}R Documentation

Print a variable and capture the output

Description

Prints a variable and captures the output, collapsing the value to a single string.

Usage

print_and_capture(x, ...)

Arguments

x

A variable.

...

Arguments passed to print methods.

Value

A string.

See Also

print, capture.output

Examples

# This is useful for including data frames in warnings or errors
message("This is the sleep dataset:\n", print_and_capture(sleep))

[Package assertive.base version 0.0-9 Index]