Data validation for aggregate_draws_to_polygons
aggregate_draws_to_polygons_validation(
draws_matrix,
aggregation_table,
aggregation_cols,
method,
z_dimension,
z_dimension_name,
weighting_raster,
na.rm
)
Errors if checks fail; silently passes if checks pass
matrix
, array
, or data.frame
corresponding to grid cell draws
that will be aggregated to polygons.
data.table::data.table Aggregation table linking pixels to
polygon identifiers, created using build_aggregation_table()
(character vector, default 'polygon_id') Polygon identifiers to use for aggregation.
(character, default 'mean') Aggregation method: one of 'mean', 'sum', 'weighted.mean', or 'weighted.sum'.
(vector, default NULL) If passing a draws_matrix
with multiple
sets of estimates, how should each layer be identified?
(default 'z') The field name for the "z" dimension
corresponding to each set of estimates contained in draws_matrix
.
(terra::SpatRaster, default NULL) The relative weighting of each whole pixel to the overall polygon value, for example, if calculating a population-weighted mean.
(bool, default TRUE) How to handle NA values in draws_matrix
and
weighting_raster
.
aggregate_draws_to_polygons