last_warnings {lifecycle}R Documentation

Display last deprecation warnings

Description

Call these helpers to see the last deprecation warnings along with their backtrace:

If you call these in the console, these warnings are printed with a backtrace. Pass the simplify argument to control the verbosity of the backtrace. It supports one of "branch" (the default), "collapse", and "none" (in increasing order of verbosity).

Usage

last_warnings()

last_warning()

Examples

# These examples are not run because `last_warnings()` does not
# work well within knitr and pkgdown
## Not run: 

f <- function() invisible(g())
g <- function() list(h(), i())
h <- function() deprecate_warn("1.0.0", "this()")
i <- function() deprecate_warn("1.0.0", "that()")
f()

# Print all the warnings that occurred during the last command:
last_warnings()

# Print only the last one:
last_warning()


# By default, the backtraces are printed in their simplified form.
# Use `simplify` to control the verbosity:
print(last_warnings(), simplify = "none")


## End(Not run)

[Package lifecycle version 0.2.0 Index]