Filter break points by checking for upstream evidence. For each break,
counts rows in evidence_table that are upstream on the same
blue_line_key. Breaks with count >= count_threshold are removed.
Arguments
- conn
A DBI::DBIConnection object (from
frs_db_conn()).- breaks
Character. Table name containing break points with
blue_line_keyanddownstream_route_measurecolumns.- evidence_table
Character. Schema-qualified table with evidence features. Must have
blue_line_keyanddownstream_route_measurecolumns.- where
Character or
NULL. SQL predicate to filter the evidence table (without leading AND/WHERE). Column references use aliase. Examples:"e.species_code IN ('CO','CH')","e.observation_date >= '1990-01-01'".- count_threshold
Integer. Minimum upstream evidence count to remove a break. Default
1(any evidence removes the break).
Details
This is generic — the evidence table can contain any point features
with blue_line_key and downstream_route_measure columns (fish
observations, water quality stations, SAR sightings, etc.). Use where
to filter the evidence to relevant records.
See also
Other habitat:
frs_break(),
frs_break_apply(),
frs_break_find(),
frs_extract()
Examples
if (FALSE) { # \dontrun{
conn <- frs_db_conn()
# Remove gradient breaks where coho or chinook were observed upstream
conn |>
frs_break_validate("working.breaks",
evidence_table = "bcfishobs.fiss_fish_obsrvtn_events_vw",
where = "e.species_code IN ('CO', 'CH')")
# Remove breaks with 5+ recent observations of any species upstream
conn |>
frs_break_validate("working.breaks",
evidence_table = "bcfishobs.fiss_fish_obsrvtn_events_vw",
where = "e.observation_date >= '1990-01-01'",
count_threshold = 5)
# Generic: validate against any point evidence table
conn |>
frs_break_validate("working.breaks",
evidence_table = "working.water_quality_sites",
where = "e.conductivity > 100")
DBI::dbDisconnect(conn)
} # }
