print_and_capture: Print a variable and capture the output

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

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

Usage

1

Arguments

x

A variable.

...

Arguments passed to print methods.

Value

A string.

See Also

print, capture.output

Examples

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

assertive.base documentation built on Feb. 8, 2021, 9:06 a.m.