Skip to contents

One short predicate for the @examplesIf guards of this package: installed packages, a configured service, or a bundled data file. Each argument is a package name or one of the tokens below; the result is TRUE when every one holds (any = TRUE: when at least one holds). Nothing is loaded or attached; nothing leaves the machine.

Usage

morie_has(..., any = FALSE)

Arguments

...

Package names or tokens, as character strings.

any

Logical; TRUE returns TRUE when any requirement holds rather than all of them.

Value

A single logical.

Details

Tokens: "sql" (DBI and RSQLite), "bigquery" (bigrquery and a GCP_PROJECT in the environment), "ollama" (a reachable local Ollama server), "sodium" (the libsodium-backed crypto routines), and a data file name such as "vpd_crime_sample.csv" (the file under this package's extdata, or the rmoriedata package).

Examples

morie_has("stats")
#> [1] TRUE
morie_has("sql")
#> [1] TRUE
morie_has("xgboost", "gbm", any = TRUE)
#> [1] TRUE
morie_has("vpd_crime_sample.csv")
#> [1] TRUE