Learn R Programming

fz (version 2.0.0)

fz_available: Check if fz Python Package is Available

Description

Checks whether the fz Python package is available in the current Python environment.

Usage

fz_available()

Arguments

Value

Logical; TRUE if fz is available, FALSE otherwise.

Version synchronisation

This package expects the funz-fz release with the same major and minor version as itself. When no Python is configured, reticulate provisions that version automatically in an ephemeral environment on first use, which downloads Python and funz-fz (see reticulate::py_require()). An existing Python environment is used as is: if its funz-fz version differs, this function offers to install the matching one in an interactive session, and warns otherwise. Nothing is changed without consent. Set options(fz.sync_python = FALSE) to disable this check. Neither step runs during R CMD check.

Details

The importable module name of the funz-fz package is fz. This function returns TRUE only when a module named fz imports and exposes the expected API (fzi/fzc/fzo/ fzr), so that an unrelated Python package that also happens to be importable as fz is not mistaken for funz-fz. All examples and tests are guarded with if (fz_available()) and therefore skip (rather than error) when the Python side is missing or misconfigured.

Examples

Run this code
# \donttest{
if (fz_available()) {
  message("fz is available!")
} else {
  message("Please install fz with fz_install()")
}
# }

Run the code above in your browser using DataLab