Annual mean density from interval (monthly / seasonal) surfaces
Source:R/density.R
density_annual.RdThe annual surface a static score consumes is the mean over ALL intervals of the year, with
an interval in which a cell carries no value counted as ZERO — not the mean over the
intervals in which the cell happens to be present. The v8 gm/nc ingests averaged only the
present intervals, which biases every cell upward and most for the sparsest species (a cell
modelled in 2 of 12 months at density 1 is 0.17 animals km^-2 year-round, not 1).
Details
Whether an UNMODELLED interval (a season NCCOS did not fit for a species, a -9999 month) is
truly zero is the caller's decision: pass only the intervals that count in n_intervals.
Examples
x <- data.frame(cell_id = c(1, 1, 2), interval = c("01", "02", "01"), dens = c(1, 1, 3))
density_annual(x, n_intervals = 12) # cell 1: 2/12; cell 2: 3/12
#> cell_id dens
#> 1 1 0.1666667
#> 2 2 0.2500000