Learn R Programming

spacyr (version 1.4.0)

spacy_installed: Check whether spaCy is installed

Description

Checks, without starting Python, whether spaCy (and optionally one or more language models) is installed in the environment that spacy_initialize() will use: the one set by RETICULATE_PYTHON if set, or otherwise the virtual environment named by SPACY_PYTHON (by default "r-spacyr"). This is useful, for instance, to skip examples or tests when spaCy is not available. If a different interpreter is already running in the R session and prevents use of the named virtual environment, returns FALSE.

Usage

spacy_installed(lang_models = NULL)

Value

TRUE if spaCy and all lang_models are installed, FALSE

otherwise.

Arguments

lang_models

character; names of language models that must also be installed, e.g. "en_core_web_sm". If NULL (the default), only spaCy itself is checked.

See Also

spacy_install(), spacy_download_langmodel()

Examples

Run this code
spacy_installed()
spacy_installed("en_core_web_sm")

Run the code above in your browser using DataLab