This function calculates coordinate weights for a dataset or time series.
.map_mark(.coord)
A data.table
that defines coordinates, with the following columns:
(required) id
---a vector that distinguishes coordinate IDs (such as grid cells or unique coordinate pairs);
(optional) timestep
---a vector that distinguishes time steps, if coordinates have been sampled through time;
(optional) mark
---a numeric
vector of coordinate weights;
The function returns a data.table
. Columns match .coord
, excluding timestep
if specified (since weights are summarised within and across time steps). There is one row for each unique coordinate ID and a mark
column that defines the associated weights.
Equal weights are assumed unless specified in the mark
column. Default or supplied weights are normalised to sum to one at each time step (if necessary). The total weight of each coordinate ID within time steps is calculated and then these weights are aggregated by coordinate ID across the whole time series (if applicable) and renormalised to sum to one.
This function is used by .map_coord()
.