.map_coord() defines coordinates and weights (marks) for utilisation distribution (UD) estimation.
Usage
.map_coord(.map, .coord, .discretise)
.map_coord.SpatRaster(.map)
.map_coord.dt(.map, .coord, .discretise)Arguments
- .map
The
terra::SpatRasterused to represent the UD. This can beNULLif.coordis provided and.discretise = FALSE.- .coord
A
matrix,data.frameordata.table::data.tablewith x and y coordinates, in columns namedxandyorcell_xandcell_y(see Details). (.coordis coerced to adata.table::data.table.) Additional columns (timestepandmark), as supported by.map_mark()are permitted. Other columns are ignored.- .discretise
A
logicalvariable that defines whether or not to discretise coordinates (i.e., redefine coordinates on.map). This is necessarilyTRUEin the wrapper functionmap_pou()but optional formap_dens().
Value
The function returns a data.table::data.table with four columns:
id—a vector of coordinate IDs (if.discretise = TRUE,idrepresents grid cells on.map);x,y—numericvectors that define coordinates (if.discretise = TRUE,xandyrepresent cell coordinates on.map);mark—anumericvector of weights, normalised to sum to one;
Details
.map_coord() function defines a data.table::data.table that includes coordinate IDs (id), coordinates (x and y) and associated weights (mark) for UD estimation. The function wraps .map_coord.SpatRaster() and .map_coord.dt().
If
.coordisNULL,.map_coord.SpatRaster()is used. This function extracts adata.table::data.tableof coordinates from.map(in nonNAregions) viaterra::as.data.frame(..., na.rm = TRUE). The values on.mapare taken as weights and must sum to one.If
.coordis supplied,.map_coord.dt()is used.xandyand/orcell_xandcell_ycolumns are expected. If.discretise = TRUE,cell_xandcell_yare used preferentially. Irrespective of whether or notxandyorcell_xandcell_yare specified, coordinates are redefined on.mapand coordinate IDs are defined as grid cell IDs on.map. If.discretise = FALSE,xandycoordinates are used preferentially. Coordinates remain unchanged and IDs are defined from the set of unique coordinate pairs. For each ID, weights are calculated by.map_mark().
See also
.map_coord() is used by map_pou() and map_dens().
