Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reporter-accessors

Get and set active reporter.


Description

get_reporter() and set_reporter() access and modify the current "active" reporter. Generally, these functions should not be called directly; instead use with_reporter() to temporarily change, then reset, the active reporter.

Usage

set_reporter(reporter)

get_reporter()

with_reporter(reporter, code, start_end_reporter = TRUE)

Arguments

reporter

Reporter to use to summarise output. Can be supplied as a string (e.g. "summary") or as an R6 object (e.g. SummaryReporter$new()).

See Reporter for more details and a list of built-in reporters.

code

Code to execute.

start_end_reporter

Should the reporters start_reporter() and end_reporter() methods be called? For expert use only.

Value

with_reporter() invisible returns the reporter active when code was evaluated.


testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.