
Area-weighted upstream means of several sampled layers
Source:R/wet_upstream_means.R
wet_upstream_means.RdThe multi-layer form of wet_upstream_mean() with denom = "covered":
for watershed a and each column x of values,
sum(x_u * area_u * cover_u) / sum(area_u * cover_u) over the
FWA_Upstream set of a, in one pass of wet_upstream_sums(). All
columns share one cover (as wet_ws_sample() returns for several
layers), so the upstream mean of a linear combination of layers is exactly
that combination of their upstream means.
Arguments
- ws
data.frame(watershed_feature_id, wscode, localcode, area_m2)for a whole basin, e.g. fromwet_ws_fetch().- values
data.frame(watershed_feature_id, <cols>, cover). Polygons absent from it count as uncovered. A polygon withcover > 0must have a value in every column.- cols
Columns of
valuesto average. Default: all butwatershed_feature_idandcover.- irregular_pairs
Passed to
wet_upstream_sums().- extra
Optional columns of
wsto average over the whole upstream area (not only the covered part), e.g. an in-BC indicator.