Skip to contents

Walks every backend supported by pr_get_tree() and reports whether the underlying package is installed (and at what version), whether it requires network, and what to do if it's missing. Useful for first-time users figuring out which backends are available, and for CI sanity checks.

Usage

pr_get_tree_status(check_network = FALSE)

Arguments

check_network

Logical. Should the probe attempt a tiny network call to test that backends needing the network are actually reachable? Default FALSE (purely local check, no side effects). Set TRUE to also test reachability — adds 1-3 seconds and requires internet.

Value

A data.frame with one row per backend and columns:

source

Backend name, as passed to pr_get_tree().

installed

Logical — is the package available?

version

Character — installed version, or NA.

needs_network

Logical — does the backend hit a remote server at runtime?

reachable

Logical or NA — result of the network check (only populated when check_network = TRUE).

install_hint

Character — the install command to run when installed = FALSE.

source_repo

Character — "CRAN" or a GitHub repo for non-CRAN backends.

See also

pr_get_tree() / pr_date_tree() for the consumers.

Examples

# Local-only probe (fast, no network)
pr_get_tree_status()
#>     source installed version needs_network reachable
#> 1     rotl      TRUE   3.1.1          TRUE        NA
#> 2   rtrees      TRUE   2.0.2         FALSE        NA
#> 3   clootl      TRUE   0.1.4         FALSE        NA
#> 4 fishtree      TRUE   0.3.4          TRUE        NA
#> 5 datelife     FALSE    <NA>         FALSE        NA
#>                       install_hint                  source_repo
#> 1         install.packages("rotl")                         CRAN
#> 2       install.packages("rtrees")                         CRAN
#> 3       install.packages("clootl")                         CRAN
#> 4     install.packages("fishtree")                         CRAN
#> 5 pak::pak("phylotastic/datelife") github::phylotastic/datelife

# \donttest{
  # Also test reachability of remote backends
  pr_get_tree_status(check_network = TRUE)
#>     source installed version needs_network reachable
#> 1     rotl      TRUE   3.1.1          TRUE      TRUE
#> 2   rtrees      TRUE   2.0.2         FALSE        NA
#> 3   clootl      TRUE   0.1.4         FALSE        NA
#> 4 fishtree      TRUE   0.3.4          TRUE     FALSE
#> 5 datelife     FALSE    <NA>         FALSE        NA
#>                       install_hint                  source_repo
#> 1         install.packages("rotl")                         CRAN
#> 2       install.packages("rtrees")                         CRAN
#> 3       install.packages("clootl")                         CRAN
#> 4     install.packages("fishtree")                         CRAN
#> 5 pak::pak("phylotastic/datelife") github::phylotastic/datelife
# }