Skip to contents

Reads the registry to find the parquet path and `time_col` for the supplied variable, opens the dataset via [arrow::open_dataset()], and returns the distinct values found in `time_col`. Useful when the `available_years` hint in the YAML is stale (or absent) and you want ground truth before passing `years = ...` to [use_hex_vars()].

Usage

get_available_years(var)

Arguments

var

A single canonical variable name, or a `pti_hex_var` already resolved via [use_hex_vars()]. Required.

Value

Integer vector of years available in the source parquet, sorted ascending. `integer(0)` for non-temporal variables.

Details

Non-temporal variables (`time_col` is `NA`) return `integer(0)`.

Examples

if (FALSE) { # \dontrun{
# Non-temporal variable -> integer(0) without hitting the network.
get_available_years("flood_exposure_15cm_1in100")
} # }