Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

session_info

An alternative to sessionInfo() to print session information


Description

This function tweaks the output of sessionInfo(): (1) It adds the RStudio version information if running in the RStudio IDE; (2) It removes the information about matrix products, BLAS, and LAPACK; (3) It removes the names of base R packages; (4) It prints out package versions in a single group, and does not differentiate between loaded and attached packages.

Usage

session_info(packages = NULL, dependencies = TRUE)

Arguments

packages

A character vector of package names, of which the versions will be printed. If not specified, it means all loaded and attached packages in the current R session.

dependencies

Whether to print out the versions of the recursive dependencies of packages.

Details

It also allows you to only print out the versions of specified packages (via the packages argument) and optionally their recursive dependencies. For these specified packages (if provided), if a function xfun_session_info() exists in a package, it will be called and expected to return a character vector to be appended to the output of session_info(). This provides a mechanism for other packages to inject more information into the session_info output. For example, rmarkdown (>= 1.20.2) has a function xfun_session_info() that returns the version of Pandoc, which can be very useful information for diagnostics.

Value

A character vector of the session information marked as raw_string().

Examples

xfun::session_info()
if (loadable("MASS")) xfun::session_info("MASS")

xfun

Miscellaneous Functions to Support Packages Maintained by 'Yihui Xie'

v0.22
MIT + file LICENSE
Authors
Yihui Xie [aut, cre, cph] (<https://orcid.org/0000-0003-0645-5666>), Wush Wu [ctb], Daijiang Li [ctb], Xianying Tan [ctb], Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>), Christophe Dervieux [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.