capture.output: Backport of capture.output for R < 3.3.0

Description Usage Examples

View source: R/capture.output.R

Description

Argument type has been backported. See the original description in utils::capture.output.

Usage

1
2
3
4
5
6
7
capture.output(
  ...,
  file = NULL,
  append = FALSE,
  type = c("output", "message"),
  split = FALSE
)

Examples

1
2
3
4
5
6
# get function from namespace instead of possibly getting
# implementation shipped with recent R versions:
bp_capture.output <- getFromNamespace("capture.output", "backports")

captured <- bp_capture.output({ message("hi") }, type = "message")
str(captured)

backports documentation built on Dec. 13, 2021, 5:08 p.m.