Debian Codegraph @

man/session_info.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/session.R
3 \name{session_info}
4 \alias{session_info}
5 \title{An alternative to sessionInfo() to print session information}
6 \usage{
7 session_info(packages = NULL, dependencies = TRUE)
8 }
9 \arguments{
10 \item{packages}{A character vector of package names, of which the versions
11 will be printed. If not specified, it means all loaded and attached
12 packages in the current R session.}
13
14 \item{dependencies}{Whether to print out the versions of the recursive
15 dependencies of packages.}
16 }
17 \value{
18 A character vector of the session information marked as
19 \code{\link[=raw_string]{raw_string()}}.
20 }
21 \description{
22 This function tweaks the output of \code{\link[=sessionInfo]{sessionInfo()}}: (1) It adds
23 the RStudio version information if running in the RStudio IDE; (2) It removes
24 the information about matrix products, BLAS, and LAPACK; (3) It removes the
25 names of base R packages; (4) It prints out package versions in a single
26 group, and does not differentiate between loaded and attached packages.
27 }
28 \details{
29 It also allows you to only print out the versions of specified packages (via
30 the \code{packages} argument) and optionally their recursive dependencies.
31 For these specified packages (if provided), if a function
32 \code{xfun_session_info()} exists in a package, it will be called and
33 expected to return a character vector to be appended to the output of
34 \code{session_info()}. This provides a mechanism for other packages to inject
35 more information into the \code{session_info} output. For example,
36 \pkg{rmarkdown} (>= 1.20.2) has a function \code{xfun_session_info()} that
37 returns the version of Pandoc, which can be very useful information for
38 diagnostics.
39 }
40 \examples{\dontshow{if (interactive()) \{}
41 xfun::session_info()
42 if (xfun::loadable("MASS")) xfun::session_info("MASS")
43 \dontshow{\}}
44 }