## `lnk_thresholds()` — configurable scoring defaults Load, merge, and return severity scoring thresholds as a named list. This is the configuration backbone — every scoring function reads from it. ### Signature ```r lnk_thresholds( csv = NULL, high = list(outlet_drop = 0.6, slope_length = 120), moderate = list(outlet_drop = 0.3), low = list() ) ``` ### Parameters All parameters have sane defaults for BC fish passage. Users in other jurisdictions override via `csv` or named arguments — no code changes needed. - `csv` — path to CSV with columns `severity`, `metric`, `value`. Overrides in-code defaults when provided. Same pattern as `frs_params(csv = ...)`. - `high`, `moderate`, `low` — named lists of metric thresholds. Merged with CSV values (CSV wins on conflict). ### Returns Named list keyed by severity level, each containing metric thresholds: ```r list( high = list(outlet_drop = 0.6, slope_length = 120), moderate = list(outlet_drop = 0.3), low = list() ) ``` ### Design intent - **System-agnostic:** metric names are user-defined strings, not hardcoded PSCIS columns - **Composable:** output feeds directly into `lnk_score_severity(thresholds = lnk_thresholds(...))` - **Discoverable:** ships `inst/extdata/thresholds_default.csv` so users can see and copy the format - **Familiar:** follows `frs_params()` pattern — CSV or code, same output shape ### Examples must show 1. Default usage (zero-config BC case) 2. CSV override for a project with custom thresholds 3. Inline override for a single metric (`lnk_thresholds(high = list(outlet_drop = 0.8))`) 4. How output plugs into `lnk_score_severity()` — show the integration, not just the function in isolation 5. The bundled CSV format so users know what to produce ### File layout - `R/lnk_thresholds.R` - `tests/testthat/test-lnk_thresholds.R` - `inst/extdata/thresholds_default.csv` Relates to #1
Activity
Add planning files and create function issues #3–#14
NewGraphEnvironment commentedon Apr 15, 2026
Built and exported. lnk_thresholds with configurable severity levels, CSV or inline override.
Research doc: refresh tables + observation #3 post spawn_lake fix