choose_avail: Choose Available Names from Set

View source: R/Data_handling.R

choose_availR Documentation

Choose Available Names from Set

Description

Available variable names are checked against the full set of expected variables and missing cases are reported.

Usage

choose_avail(names, all_names, show_ignored = FALSE, warn = TRUE)

Arguments

names

A character vector with available names.

all_names

A character vector with all expected variable names.

show_ignored

A logical value. Should ignored names be shown?

warn

A logical value. Should you be warned if names or all_names contain duplicates?

Value

A character vector with subset of expected variable names.

Examples

# all available names to choose from
all_names <- c("TA", "TS", "VPD", "LE", "H", "NEE")

# names to choose if present in all_names
# - "PM10" wanted but not available - thus reported as not available
# - c("TA", "TS", "VPD", "NEE") available but not wanted, thus ignored
names <- c("H", "LE", "PM10")
choose_avail(names, all_names)


lsigut/openeddy documentation built on Aug. 5, 2023, 12:25 a.m.