R/print_and_capture.r

Defines functions print_and_capture

Documented in print_and_capture

print_and_capture <- function(x, spaces = 0) {
 str1 <- utils::capture.output(print(x))
 if ( spaces > 0) {
      str2 <- paste(rep(" ", spaces), collapse="")
      str1 <- paste(str2, str1)
 }
 paste(str1, collapse="\n")}

Try the eatTools package in your browser

Any scripts or data that you put into this service are public.

eatTools documentation built on Nov. 23, 2023, 5:06 p.m.