Skip to contents

S3 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, or sessioncheck_sessionstatediff

...

Ignored

platform

For sessioncheck_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, 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_sessionstate objects, an optional character vector selecting which package inventory columns to display (see sessionstate() for the full list of columns). Defaults to c("package", "attached", "loaded_version", "source"). For sessioncheck_sessionstatediff objects, the same column selection and default apply to the added/removed blocks of the "Packages" section (the modified block always shows its own fixed field/old/new columns, so packages does not affect it). Ignored for other classes. See Details for how the default is resolved.

globalenv

For sessioncheck_sessionstate objects, an optional character vector selecting which global environment columns to display (from "name", "class", "size", "hash"). Defaults to c("name", "class", "size") (omitting "hash", a long fingerprint mainly useful programmatically – see compare_sessionstates()). For sessioncheck_sessionstatediff objects, the same column selection and default apply to the added/removed blocks of the "Global environment" section (the modified block is unaffected – see packages above). Ignored for other classes. See Details for how the default is resolved, and for how globalenv_n separately controls the number of rows shown for sessioncheck_sessionstate objects.

globalenv_n

For sessioncheck_sessionstate objects, an optional single number giving the maximum number of globalenv rows to display, largest objects first. Defaults to 10. Ignored for other classes. See Details for how the default is resolved.

attachments

For sessioncheck_sessionstate objects, an optional character vector selecting which attached-environment columns to display (from "name", "type"). Defaults to showing all columns. For sessioncheck_sessionstatediff objects, the same column selection applies to the added/removed blocks of the "Attached environments" section (which has no modified block at all – see compare_sessionstates()). Ignored for other classes. See Details for how the default is resolved.

changed_only

For sessioncheck_sessionstatediff objects, whether to collapse sections/fields with no detected change down to a single "(no changes)" line (TRUE by default) or always show every field. Ignored for other classes. See Details for how the default is resolved.

max_rows

For sessioncheck_sessionstatediff objects, an optional single number giving the maximum number of rows to display in each added/removed/modified block of the "Packages", "Global environment", and "Attached environments" sections. Defaults to 10. Ignored for other classes. See Details for how the default is resolved.

Value

Character vector

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.