Capture output from print()
of an object.
Usage
save_print(object, collapse = "\n")
save_object_info(object)
Arguments
- object
An object to be printed.
- collapse
A character scalar: used to collapse the output lines.
Value
A character scalar for save_print()
,
list(str = save_print(object), dim = dim(object))
for save_object_info()
.
Examples
save_print(lm(mpg ~ cyl, datasets::mtcars))
#> [1] "\nCall:\nlm(formula = mpg ~ cyl, data = datasets::mtcars)\n\nCoefficients:\n(Intercept) cyl \n 37.885 -2.876 \n"