Package 'sessioninfo'

Title: R Session Information
Description: Query and print information about the current R session. It is similar to 'utils::sessionInfo()', but includes more information about packages, and where they were installed from.
Authors: Gábor Csárdi [cre], Hadley Wickham [aut], Winston Chang [aut], Robert Flight [aut], Kirill Müller [aut], Jim Hester [aut], R Core team [ctb], Posit Software, PBC [cph, fnd]
Maintainer: Gábor Csárdi <[email protected]>
License: GPL-2
Version: 1.2.2.9000
Built: 2024-06-11 05:17:37 UTC
Source: https://github.com/r-lib/sessioninfo

Help Index


Information about related software

Description

Information about related software

Usage

external_info()

Details

Note that calling this function will attempt to load the tcltk and grDevices packages.

Value

A list with elements:

  • cairo: The cairo version string.

  • libpng: The png version string.

  • jpeg: The jpeg version string.

  • tiff: The tiff library and version string used.

  • tcl: The tcl version string.

  • curl: The curl version string.

  • zlib: The zlib version string.

  • bzlib: The zlib version string.

  • xz: The zlib version string.

  • PCRE: The Perl Compatible Regular Expressions (PCRE) version string.

  • ICU: The International Components for Unicode (ICU) version string.

  • TRE: The TRE version string.

  • iconv: The iconv version string.

  • readline: The readline version string.

  • BLAS: The path with the implementation of BLAS in use.

  • LAPACK: The path with the implementation of LAPACK in use.

See Also

Similar functions and objects in the base packages: utils::sessionInfo(), base::extSoftVersion, tcltk::tclVersion() base::La_library, base::La_version(), base::libcurlVersion().

Examples

external_info()

Human readable name of the current operating system

Description

For example Windows 8.1 instead of Windows version 6.3.9600. On macOS it includes the code names, on Linux it includes the distribution names and codenames if appropriate.

Usage

os_name()

Details

It uses utils::sessionInfo(), but simplifies its output a bit on Windows, to make it more concise.

Value

A character scalar.


Information about the currently loaded packages, or about a chosen set

Description

Information about the currently loaded packages, or about a chosen set

Usage

package_info(
  pkgs = c("loaded", "attached", "installed")[1],
  include_base = FALSE,
  dependencies = NA
)

Arguments

pkgs

Which packages to show. It may be:

  • NULL or "loaded": show all loaded packages,

  • "attached": show all attached packages,

  • "installed": show all installed packages,

  • a character vector of package names. Their (hard) dependencies are also shown by default, see the dependencies argument.

include_base

Include base packages in summary? By default this is false since base packages should always match the R version.

dependencies

Whether to include the (recursive) dependencies as well. See the dependencies argument of utils::install.packages().

Value

A data frame with columns:

  • package: package name.

  • ondiskversion: package version (on the disk, which is sometimes not the same as the loaded version).

  • loadedversion: package version. This is the version of the loaded namespace if pkgs is NULL, and it is the version of the package on disk otherwise. The two of them are almost always the same, though.

  • path: path to the package on disk.

  • loadedpath: the path the package was originally loaded from.

  • attached: logical, whether the package is attached to the search path.

  • is_base: logical, whether the package is a base package.

  • date: the date the package was installed or built, in UTC.

  • source: where the package was installed from. E.g. CRAN, GitHub, local (from the local machine), etc.

  • md5ok: Whether MD5 hashes for package DLL files match, on Windows. NA on other platforms.

  • library: factor, which package library the package was loaded from. For loaded packages, this is (the factor representation of) loadedpath, for others path.

See session_info() for the description of the printed columns by package_info (as opposed to the returned columns).

Examples

package_info()
package_info("sessioninfo")

Information about the current platform

Description

Information about the current platform

Usage

platform_info()

Value

A list with elements:

  • version: the R version string.

  • os: the OS name in human readable format, see os_name().

  • system: CPU, and machine readable OS name, separated by a comma.

  • ui: the user interface, e.g. Rgui, RTerm, etc. see GUI in base::.Platform.

  • language: The current language setting. The LANGUAGE environment variable, if set, or (EN) if unset.

  • collate: Collation rule, from the current locale.

  • ctype: Native character encoding, from the current locale.

  • tz: The current time zone.

  • date: The current date.

  • rstudio: RStudio format string, only added in RStudio.

  • pandoc: pandoc version and path

See Also

Similar functions and objects in the base packages: base::R.version.string, utils::sessionInfo(), base::version, base::.Platform, base::Sys.getlocale(), base::Sys.timezone().

Examples

platform_info()

Python configuration

Description

Python configuration

Usage

python_info()

Value

Returns a reticulate::py_config object, which also has the python_info class. It is a named list of values.

If reticulate is not installed or Python is not configured, then it return a python_info object that is a character vector, and it does not have a py_config class.

Examples

python_info()
session_info(info = "all")

Compare session information from two sources

Description

Compare session information from two sources

Usage

session_diff(
  old = "local",
  new = "clipboard",
  packages = c("diff", "merge"),
  ...
)

Arguments

old, new

A session_info object (the return value of session_info()), or a pointer to session_info() output. See details below.

packages

How to compare the package info for old and new:

  • "diff": line diffs, in the style of diff -u

  • "merge": merge the information into one data frame, with one row per package. Only package version and source are compared.

...

Passed to any new session_info() calls.

Details

Various way to specify old and new:

  • A session_info object.

  • "local" runs session_info() in the current session, and uses its output.

  • "clipboard" takes the session info from the system clipboard. If the clipboard contains a URL, it is followed to download the session info.

  • The URL where you inspect the results for a GitHub Actions job. Typically has this form:

    https://github.com/OWNER/REPO/actions/runs/RUN_ID/jobs/HTML_ID
    

    Internally, this URL is parsed so we can look up the job id, get the log file, and extract session info.

  • Any other URL starting with ⁠http://⁠ or ⁠https://⁠. session_diff() searches the HTML (or text) page for the session info header to find the session info.

Examples

session_diff()

Print session information

Description

This is utils::sessionInfo() re-written from scratch to both exclude data that's rarely useful (e.g., the full collate string or base packages loaded) and include stuff you'd like to know (e.g., where a package was installed from).

Usage

session_info(
  pkgs = c("loaded", "attached", "installed")[1],
  include_base = FALSE,
  info = c("auto", "all", "platform", "packages", "python", "external"),
  dependencies = NA,
  to_file = FALSE
)

Arguments

pkgs

Which packages to show. It may be:

  • NULL or "loaded": show all loaded packages,

  • "attached": show all attached packages,

  • "installed": show all installed packages,

  • a character vector of package names. Their (hard) dependencies are also shown by default, see the dependencies argument.

include_base

Include base packages in summary? By default this is false since base packages should always match the R version.

info

What information to show, it can be "auto" to choose automatically, "all" to show everything, or a character vector with elements from:

dependencies

Whether to include the (recursive) dependencies as well. See the dependencies argument of utils::install.packages().

to_file

Whether to print the session information to a file. If TRUE the name of the file will be session-info.txt, but to_file may also be a string to specify the file name.

Details

Columns in the printed package list:

  • package: package name

  • *: whether the package is attached to the search path

  • version: package version. If the version is marked with ⁠(!)⁠ that means that the loaded and the on-disk version of the package are different.

  • date: when the package was built, if this information is available. This is the Date/Publication or the Built field from DESCRIPTION. (These are usually added automatically by R.) Sometimes this data is not available, then it is NA.

  • source: where the package was built or installed from, if available. Examples: ⁠CRAN (R 3.3.2)⁠, ⁠Github (r-lib/pkgbuild@8aab60b)⁠, Bioconductor, local.

See package_info() for the list of columns in the data frame that is returned (as opposed to printed).

Value

A session_info object.

If to_file is not FALSE then it is returned invisibly. (To print it to both a file and to the screen, use (session_info(to_file = TRUE)).)

Examples

session_info()
session_info("sessioninfo")