Skip to contents

Uses sessioninfo::package_info() to provide information about the loaded, attached, or installed packages. The primary use case is to verify that a package is installed; check the version number of a specific packages; or determine which packages are already in use in a session.

Usage

btw_tool_session_package_info(packages = "attached", dependencies = "")

Arguments

packages

Which packages to show, or "loaded" to show all loaded packages, "attached" to show all attached packages, or "installed" to show all installed packages.

dependencies

Whether to include the dependencies when listing package information.

Value

Returns a string describing the selected packages.

Examples

cat(btw_tool_session_package_info("btw"))
#> ```
#>  package * version    date (UTC) lib source
#>  btw     * 0.0.1.9000 2025-04-16 [1] local
#> 
#>  [1] /home/runner/work/_temp/Library
#>  [2] /opt/R/4.5.0/lib/R/site-library
#>  [3] /opt/R/4.5.0/lib/R/library
#>  * ── Packages attached to the search path.
#> ```