Skip to content

reportr

2.0.0Package record

A General Message and Error Reporting System

2packages dependsuggested by 1
11.3Kdownloads / year
85.9%test coverage
13/13flavors OK

Overview

About

Provides a system for reporting messages, which provides certain useful features over the standard R system, such as the incorporation of output consolidation, message filtering, assertions, expression substitution, automatic generation of stack traces for debugging, and conditional reporting based on the current "output level". Messages are signalled as classed R conditions, so that calling code can decide how serious a situation is, rather than the function which detects it having to be told in advance.

Changes in 2.0.0
  • Every message is now signalled as a classed R condition before it is reported. The class vector always includes one derived from the level of the message, such as "reportrInfo", so existing code gains conditions without any changes. See ?reportrCondition.
  • The report(), flag() and assert() functions gain a "class" argument, which attaches further classes of the caller's choosing to a message, and a "call" argument giving the call to associate with the condition. Classed messages are signalled even when the output level means that they will not be reported.
  • The new reportAs() function changes the level at which particular classes of condition are reported, so that the caller can decide how serious a situation is.
Show all changes in 2.0.0Hide the rest of the changes in 2.0.0
  • The new fallback() function raises an error which the caller may demote, returning a value of the signalling function's choosing instead. Only errors raised this way can be demoted, since others provide no value to continue with.
  • withReportrHandlers() now also accepts named arguments mapping condition classes to levels or to handler functions, and reportrHandlers() installs the same translations for a whole session using globalCallingHandlers(), which requires R 4.0.0 or later. The package itself needs only R 3.5.0.
  • Conditions translated by withReportrHandlers() keep the classes of R's original condition, which is also stored in their "original" element, so a handler further out can still match them by class.
  • Messages can now be written to files, connections and functions as well as, or instead of, the terminal, using setOutputTargets() with toTerminal(), toFile() and toFunction(). Each output target may have its own level threshold and prefix format. See ?targets.
  • The new "%t" prefix escape expands to the current time, formatted according to the new "reportrTimeFormat" option.
  • The new "reportrBaseClasses" option, if TRUE, makes conditions at level Warning inherit from "warning", and those at level Info and below from "message", so that suppressWarnings() and suppressMessages() affect them.
  • The new level OL$Ignore, below OL$Debug, can be used with reportAs() to suppress a class of condition entirely.

BREAKING CHANGES

  • Errors raised by report() and friends are now caught by try() and by tryCatch(expr, error=...), since the conditions signalled inherit from "error". Previously they could not be caught at all. Code which wrapped a reporting function in try() to guard against other errors may now find it catching reportr errors as well.
  • An error is now fatal whatever the current output level, and whether or not its message is filtered out of the output. Previously either could prevent it from taking effect.
  • OL$Fatal now ends execution in the same way as OL$Error. Previously it was reported but not acted upon.
  • The reportrStackFilterIn and reportrStackFilterOut options have been removed.
  • An assertion whose expression itself reports an error is now a failed assertion, and reports the message given to assert(), rather than ending execution. This matches what already happened when the expression raised an error in R's own way.
  • flag() signals its condition at the point where the message is flagged, rather than when it is eventually reported. A flagged message at level Error or above is therefore fatal at that point.
  • Flagged messages, including warnings consolidated by withReportrHandlers(), are now written with the usual prefix format, rather than always with "%L: ". With the default format they are therefore indented to show the call depth at which they were flagged.
  • The "prefixFormat" argument to report(), ask() and assert() is deprecated, since prefix formats now belong to output targets. The value "", which suppresses the prefix, is still honoured, and is equivalent to the new "prefix=FALSE"; any other value is ignored, with a warning the first time.
  • ask() now asks its question in a non-interactive session, such as a script run with Rscript, if standard input is a terminal, reading the answer from there. Previously it always returned its default in such sessions. Setting the new "reportrAskInScripts" option to FALSE restores the old behaviour.
  • The package now requires R 3.5.0 or later.

BUG FIXES

  • Expression substitution is no longer applied twice to consolidated messages reported by reportFlags(), or to messages passed to assert(). Text containing "#{...}" is now reported literally in these cases, as intended.
  • Message text arriving from outside reportr, via withReportrHandlers(), is no longer passed through es(). Previously a foreign message containing the "#{...}" syntax would have it evaluated.
  • The environment used for expression substitution is now passed explicitly rather than being inferred from the call depth, so it remains correct regardless of how a message reaches the reporting code.
  • withReportrHandlers() now returns the value of its expression invisibly if that value was invisible, so wrapping an expression no longer changes what the console prints.
  • Stack traces for messages reported at top level no longer contain a spurious "NA" entry.
  • The "%f" prefix escape no longer causes an error when a message is reported at top level; it expands to an empty string instead.
  • Namespace-qualified calls, such as reportr::report(), no longer add spurious depth to the "%d" prefix escape or to stack traces, and "%f" now gives just the function name for a qualified call.

From NEWS in the release

Install

Health

CRAN checks
13OK
Slowest check: 54 s · r-release-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 2.0.0
READMEYes · 2,220 wordsVignettesNoNEWSYes · 33% structured · mentions 2.0.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
7includes a package overview page
Examples that run
83%5 run in a plain check · 1 never run
Exported functions with examples
86%
Documented parameters
96%
Return-value docs
86%
Help pages citing references
0%

Downloads

11.3K
CRAN downloads in the past year
Rank #4,118 · ~31/day · ~940/mo
Daily download trend is not available in this view yet.
97130 days
2.2K90 days
11.3K1 year
Compare downloads with other packages →
Also on121 r2u4 autocran1.7K conda_forge140 c2d4u

Repository

7Stars
1Forks
0Open issues
0Open PRs
2Releases
96Commits
1Commit identities
r
96 commits · Last activity 2026-10-13 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
not measured
Median days to close, 50 most recently updated closed issues
3
Median days to close, 50 most recently updated closed PRs
not measured

Stars over time

2025-06-25 · 72026-07-07 · 7
PracticesBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/jonclayden/reportr on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux and Windows

Coverage (1)
Coverage reporting
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
3 external dependencies (excludes base and recommended)

Installing reportr adds 1 package (1 with compiled code, 488 KB of source tarballs). Heaviest: ore 488 KB.

Depends (1)
R >= 3.5.0
Imports (1)
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
2direct
1indirect
Imports 2
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (1)
Author, Maintainer since 0.1.0 (2010)
Releases (13)

Pick two releases to compare their code metrics.

  • 2.0.0Latest
    record
    2026-10-13 · current release · diff ↗ ·
    added 9 exports
    fallback, getOutputTargets, reportAs, reportrCondition, reportrHandlers, setOutputTargets, toFile, toFunction, toTerminal
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 1.3.1
    record
    2025-03-30 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • 1.3.0
    record
    2018-10-26 · diff ↗ ·
    added 1 export
    assert
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • 1.2.2
    record
    2016-10-06 · diff ↗
  • R
    R 3.3.0 released · 2016-05-03
  • 1.2.1
    record
    2016-04-01 · diff ↗
Show 15 earlier eventsHide 15 earlier events
  • 1.2.0
    record
    2015-10-14 · diff ↗ ·
    removed 1 export
    pattern:^[^\\.]
    added 9 exports
    OL, ask, clearFlags, flag, getOutputLevel, report, reportFlags, setOutputLevel, withReportrHandlers
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • 1.1.2
    record
    2014-03-12 · diff ↗
  • 1.1.1
    record
    2014-02-26 · diff ↗
  • 1.1.0
    record
    2013-12-04 · diff ↗
  • 1.0.1
    record
    2013-07-23 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • R
    R 2.15.0 released · 2012-03-30
  • R
    R 2.14.0 released · 2011-10-31
  • 1.0.0
    record
    2011-10-25 · diff ↗
  • 0.2.0
    record
    2011-07-28 · diff ↗ ·
    added 1 export
    pattern:^[^\\.]
  • R
    R 2.13.0 released · 2011-04-13
  • 0.1.0
    record
    2010-10-27
  • R
    R 2.12.0 released · 2010-10-15

Package metadata

First published
2010-10-27
Total releases
13 / 16 yrs
License
GPL-2 OSI
Minimum R
≥ 3.5.0
Download size
43 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("reportr")
Clayden, J. (2026). reportr: A General Message and Error Reporting System (Version 2.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.reportr

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for reportr version 2.0.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy