Get merchantability criteria for a jurisdiction/species (BEC-aware for BC)
Source:R/get_merch_criteria.R
get_merch_criteria.RdConvenience helper to fetch CBM-style merchantability criteria (stump height,
top diameter, and minimum DBH) from the internal merchcrit lookup table.
Usage
get_merch_criteria(
jurisdiction,
species = NA_character_,
bec_zone = NA_character_,
verbose = TRUE
)Arguments
- jurisdiction
Province/Territory code (e.g.,
"BC","AB").- species
Species code. Optional for
"BC"; if missing, falls back to"ALL"with a warning.- bec_zone
Optional BEC zone code (e.g.,
"CWH","ICH"). If missing for"BC", conservative criteria are taken fromBEC_group == "UNKNOWN".- verbose
If TRUE, warns when BC falls back to genus-level, UNKNOWN BEC, or ALL.
Details
Before lookup, inputs are standardized using internal helpers:
standardize_jurisdiction_code()forjurisdictionstandardize_species_code()forspecies(keeps"ALL"as-is)
Rules:
For British Columbia (
"BC"),speciesis OPTIONAL:If
speciesis missing, the function falls back toSpecies == "ALL"and warns.If
bec_zoneis provided and can be mapped, criteria are looked up using (Province + Species + BEC_group).If
bec_zoneis missing/unknown, criteria fall back to a conservative BC BEC-independent layer usingBEC_group == "UNKNOWN"(species-specific if present, otherwiseSpecies == "ALL").If no exact species match is found, the function falls back to genus-level rules (e.g.,
PICE.GLA->PICE.SPP) and then toSpecies == "ALL".
For other jurisdictions, criteria are jurisdiction-level (Province) only and species/BEC are ignored.
Stump height is returned in metres (converted from centimetres).
Examples
get_merch_criteria("ON")
#> # A tibble: 1 × 5
#> jurisdiction species stumpht_m topdbh_cm mindbh_cm
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 ON ALL 0.3 13.1 9
get_merch_criteria("PEI") # standardized to "PE"
#> # A tibble: 1 × 5
#> jurisdiction species stumpht_m topdbh_cm mindbh_cm
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 PE ALL 0.15 8 9
get_merch_criteria("BC", "PSEU.MEN", "CWH") # BEC-aware
#> # A tibble: 1 × 5
#> jurisdiction species stumpht_m topdbh_cm mindbh_cm
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 BC PSEU.MEN 0.3 15 17.5
get_merch_criteria("BC", "PICE.GLA", "CWH") # genus fallback to PICE.SPP if present
#> # A tibble: 1 × 5
#> jurisdiction species stumpht_m topdbh_cm mindbh_cm
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 BC PICE.GLA 0.3 15 17.5
get_merch_criteria("BC") # falls back to BC ALL + UNKNOWN (warns)
#> Warning: For jurisdiction 'BC', `species` was not provided; using BC fallback Species='ALL'.
#> Warning: bec_zone missing; using conservative BC 'UNKNOWN' utilization.
#> # A tibble: 1 × 5
#> jurisdiction species stumpht_m topdbh_cm mindbh_cm
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 BC ALL 0.3 15 17.5