A segment's grade is the curve's predicted detection rate at the segment's
size, gradient and distance to a river, at the reference nuisance values and
with the group random effect excluded (so grades compare across groups),
divided by the ref_quantile of that rate over the species' accessible
segments (those of them ref_rows marks), and capped at 1. The top of the
reference segments reads 1, and a segment at a third of that rate reads about
0.3. It is expected use per standard electrofishing visit, not habitat
quality, and is labelled so.
Arguments
- curve
the list
knw_tune_curve()returns.- segments
data.framewithaccessible(logical) and the columnscolsname: the size variable the curve was fit on, the gradient, anddist_m(metres to the first river of the curve'sq;NAorInfwhere none).- cols
named
character:size,grad,dist.- ref_quantile
numeric(1)the quantile of the reference segments' rate (accessible, and marked byref_rows) that reads 1.- classes
numericthe class breaks on the grade.- ref_rows
NULL, or a logical vector ofnrow(segments)marking the segments the reference is taken over (among the accessible ones), such as the stream branch the curve was fitted on.NULLtakes every accessible segment. Every segment is graded either way.
Value
A list: grades, a tibble of nrow(segments) with rate,
grade, grade_class; reference, the rate that reads 1; dropped,
counts of segments with no size or gradient.
Details
A segment whose size variable is missing (an unmeasured first-order stream
under a width model; a segment with no flow even from a parent under a MAD
model) or whose gradient is missing gets NA, and the counts come back. A
missing distance is the cap (dist_cap_m): the walk found no river of at
least the curve's q downstream (the sea came first, or the walk stopped),
not that the segment is far from any river. knw_grade_species() walks every
gradable accessible segment, so a segment reads the cap only for that reason.
