sessioncheck() is the top-level orchestrator for this package's
individual session checks: it runs one or more check_*() functions
(e.g. check_attached_packages(), check_globalenv_objects()) in a
single call and combines their results. Like the individual checks it
wraps, it can produce errors, warnings, or messages if requested.
Arguments
- action
Behavior to take if the status is not clean. Possible values are "error", "warn", "message", and "none". If the user does not specify an action, the default is
action = "warn".- checks
Character vector listing the checks to run. If the user does not specify the checks, the default is to run
checks = c("globalenv_objects", "attached_packages", "attached_environments").- action_on_pass
Behavior to take if the status is clean. Possible values are "message" and "none". If the user does not specify a value, the default is
action_on_pass = "none".- ...
Arguments passed to individual checks.
Details
The following arguments are recognized via ...:
allow_globalenv_objectsis passed tocheck_globalenv_objects()allow_attached_packagesis passed tocheck_attached_packages()allow_attached_environmentsis passed tocheck_attached_environments()allow_loaded_namespacesis passed tocheck_loaded_namespaces()max_sessiontimeis passed tocheck_sessiontime()required_optionsis passed tocheck_required_options()required_localeis passed tocheck_required_locale()required_sysenvis passed tocheck_required_sysenv()required_wdis passed tocheck_working_directory()
Other arguments are ignored.
Examples
sessioncheck(action = "message")
#> Session check results:
#> ✔ No unexpected objects in global environment
#> ✖ Unexpected packages: sessioncheck
#> ✔ No unexpected environments attached
# a session with nothing flagged by the default checks: `action` only
# controls what happens when a problem *is* found, so pass
# `action_on_pass = "message"` to confirm the clean result instead
sessioncheck(
action = "none",
allow_globalenv_objects = ls(envir = .GlobalEnv, all.names = TRUE),
allow_attached_packages = .packages(),
allow_attached_environments = search(),
action_on_pass = "message"
)
#> Session check results:
#> ✔ No unexpected objects in global environment
#> ✔ No unexpected packages attached
#> ✔ No unexpected environments attached