Skip to contents

Checks if a package is installed in the current session. If the package is installed, it returns the version number. If not, it suggests packages with similar names to help the LLM resolve typos.

Usage

btw_tool_session_check_package_installed(package_name)

Arguments

package_name

The name of the package.

Value

A message indicating whether the package is installed and its version, or an error indicating that the package is not installed.

See also

Examples

btw_tool_session_check_package_installed("dplyr")@value
#> [1] "Package `dplyr` version 1.1.4 is installed."

tryCatch(
  btw_tool_session_check_package_installed("dplry"),
  error = function(err) {
    cat(conditionMessage(err))
  }
)
#> Package dplry is not installed.
#>  Did you mean "dplyr", "rpart", "R6", "bslib", or "callr"?