Skip to contents

The 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).

Usage

density_annual(x, n_intervals, value = "dens")

Arguments

x

a data frame with columns cell_id, an interval column and a density column; one row per (cell, interval) where the cell has a value.

n_intervals

integer; the number of intervals in the year (12 months, 4 seasons).

value

name of the density column (default "dens").

Value

a data frame (cell_id, dens) — dens = Σ interval density / n_intervals.

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