File: session_info.Rd

package info (click to toggle)
r-cran-xfun 0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/session.R
\name{session_info}
\alias{session_info}
\title{An alternative to sessionInfo() to print session information}
\usage{
session_info(packages = NULL, dependencies = TRUE)
}
\arguments{
\item{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.}

\item{dependencies}{Whether to print out the versions of the recursive
dependencies of packages.}
}
\value{
A character vector of the session information marked as
  \code{\link{raw_string}()}.
}
\description{
This function tweaks the output of \code{\link{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.
}
\details{
It also allows you to only print out the versions of specified packages (via
the \code{packages} argument) and optionally their recursive dependencies.
For these specified packages (if provided), if a function
\code{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
\code{session_info()}. This provides a mechanism for other packages to inject
more information into the \code{session_info} output. For example,
\pkg{rmarkdown} (>= 1.20.2) has a function \code{xfun_session_info()} that
returns the version of Pandoc, which can be very useful information for
diagnostics.
}
\examples{
xfun::session_info()
if (loadable("MASS")) xfun::session_info("MASS")
}