R: An alternative to sessionInfo() to print session information

session_info {xfun} | R Documentation

## 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")

[Package xfun version 0.20 Index]