Format and print sessioncheck objects
Source:R/class.R, R/sessionstate-format.R, R/sessionstatediff-format.R
display_methods.RdS3 format()/print() methods for the three classes this package
defines. sessioncheck_status/sessioncheck_sessioncheck objects render
as a one-line-per-check status summary; sessioncheck_sessionstate
objects render as a multi-section report, and the arguments below let
that report be filtered down to specific fields or columns per section.
Usage
# S3 method for class 'sessioncheck_status'
format(x, ...)
# S3 method for class 'sessioncheck_sessioncheck'
format(x, ...)
# S3 method for class 'sessioncheck_status'
print(x, ...)
# S3 method for class 'sessioncheck_sessioncheck'
print(x, ...)
# S3 method for class 'sessioncheck_sessionstate'
format(
x,
platform = NULL,
locale = NULL,
matrix = NULL,
document = NULL,
machine = NULL,
git = NULL,
timing = NULL,
rng = NULL,
packages = NULL,
globalenv = NULL,
globalenv_n = NULL,
attachments = NULL,
...
)
# S3 method for class 'sessioncheck_sessionstate'
print(
x,
platform = NULL,
locale = NULL,
matrix = NULL,
document = NULL,
machine = NULL,
git = NULL,
timing = NULL,
rng = NULL,
packages = NULL,
globalenv = NULL,
globalenv_n = NULL,
attachments = NULL,
...
)
# S3 method for class 'sessioncheck_sessionstatediff'
format(
x,
changed_only = NULL,
packages = NULL,
globalenv = NULL,
attachments = NULL,
max_rows = NULL,
...
)
# S3 method for class 'sessioncheck_sessionstatediff'
print(
x,
changed_only = NULL,
packages = NULL,
globalenv = NULL,
attachments = NULL,
max_rows = NULL,
...
)Arguments
- x
An object of class
sessioncheck_status,sessioncheck_sessioncheck,sessioncheck_sessionstate, orsessioncheck_sessionstatediff- ...
Ignored
- platform
For
sessioncheck_sessionstateobjects, an optional character vector selecting which platform fields to display (from"version","os","system","ui","tz","date"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- locale
For
sessioncheck_sessionstateobjects, an optional character vector selecting which locale fields to display (from"language","collate","ctype"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- matrix
For
sessioncheck_sessionstateobjects, an optional character vector selecting which matrix-products fields to display (from"blas","lapack"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- document
For
sessioncheck_sessionstateobjects, an optional character vector selecting which document-products fields to display (from"pandoc","quarto"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- machine
For
sessioncheck_sessionstateobjects, an optional character vector selecting which machine fields to display (from"nodename","user","cwd"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- git
For
sessioncheck_sessionstateobjects, an optional character vector selecting which git fields to display (from"sha","dirty"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- timing
For
sessioncheck_sessionstateobjects, an optional character vector selecting which timing fields to display (from"captured_at","elapsed_sec"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- rng
For
sessioncheck_sessionstateobjects, an optional character vector selecting which RNG fields to display (from"kind","normal_kind","sample_kind","seed_hash"). Defaults to showing all fields. Ignored for other classes. See Details for how the default is resolved.- packages
For
sessioncheck_sessionstateobjects, an optional character vector selecting which package inventory columns to display (seesessionstate()for the full list of columns). Defaults toc("package", "attached", "loaded_version", "source"). Forsessioncheck_sessionstatediffobjects, the same column selection and default apply to theadded/removedblocks of the "Packages" section (themodifiedblock always shows its own fixedfield/old/newcolumns, sopackagesdoes not affect it). Ignored for other classes. See Details for how the default is resolved.- globalenv
For
sessioncheck_sessionstateobjects, an optional character vector selecting which global environment columns to display (from"name","class","size","hash"). Defaults toc("name", "class", "size")(omitting"hash", a long fingerprint mainly useful programmatically – seecompare_sessionstates()). Forsessioncheck_sessionstatediffobjects, the same column selection and default apply to theadded/removedblocks of the "Global environment" section (themodifiedblock is unaffected – seepackagesabove). Ignored for other classes. See Details for how the default is resolved, and for howglobalenv_nseparately controls the number of rows shown forsessioncheck_sessionstateobjects.- globalenv_n
For
sessioncheck_sessionstateobjects, an optional single number giving the maximum number ofglobalenvrows to display, largest objects first. Defaults to10. Ignored for other classes. See Details for how the default is resolved.- attachments
For
sessioncheck_sessionstateobjects, an optional character vector selecting which attached-environment columns to display (from"name","type"). Defaults to showing all columns. Forsessioncheck_sessionstatediffobjects, the same column selection applies to theadded/removedblocks of the "Attached environments" section (which has nomodifiedblock at all – seecompare_sessionstates()). Ignored for other classes. See Details for how the default is resolved.- changed_only
For
sessioncheck_sessionstatediffobjects, whether to collapse sections/fields with no detected change down to a single "(no changes)" line (TRUEby default) or always show every field. Ignored for other classes. See Details for how the default is resolved.- max_rows
For
sessioncheck_sessionstatediffobjects, an optional single number giving the maximum number of rows to display in eachadded/removed/modifiedblock of the "Packages", "Global environment", and "Attached environments" sections. Defaults to10. Ignored for other classes. See Details for how the default is resolved.
Details
For sessioncheck_sessionstate objects, the platform/locale/matrix/
document/machine/git/timing/rng/packages/globalenv/
globalenv_n/attachments
arguments are resolved through the same precedence used elsewhere in the
package: an explicit argument always wins; otherwise,
getOption("sessioncheck") is checked for a sessionstate_platform,
sessionstate_locale, sessionstate_matrix, sessionstate_document,
sessionstate_machine, sessionstate_git, sessionstate_timing,
sessionstate_rng, sessionstate_packages, sessionstate_globalenv,
sessionstate_globalenv_n, or sessionstate_attachments field
(respectively); if neither is set, a
built-in default is used (showing every field/column, except for
packages, which defaults to
c("package", "attached", "loaded_version", "source"),
globalenv, which defaults to c("name", "class", "size"), and
globalenv_n, which defaults to 10). This selection only affects what
is displayed; it never changes the underlying object, so
as.data.frame() always returns the full package
inventory, and x$globalenv/x$attachments always return their full
data frames, regardless of any selection in effect.
For sessioncheck_sessionstatediff objects, changed_only/packages/
globalenv/attachments/max_rows are resolved through the same
precedence: an explicit argument always wins; otherwise
getOption("sessioncheck") is checked for a
sessionstatediff_changed_only, sessionstatediff_packages,
sessionstatediff_globalenv, sessionstatediff_attachments, or
sessionstatediff_max_rows field (respectively); if neither is set, a
built-in default is used: TRUE for changed_only, 10 for
max_rows, and the same packages/globalenv/attachments defaults
as sessioncheck_sessionstate objects use (see above). max_rows
applies independently to every added/removed/modified block, and
does not affect the underlying object – as.data.frame() on a
sessioncheck_sessionstatediff always returns every row.