get_mask()
extracts the static mask from a BirdFlow model. The
static mask is a logical raster indicating which cells are included in the
model (at any timestep). These are also the cells (in row major order)
that correspond with distribution values, and location indices.
Arguments
- bf
A BirdFlow model
- format
One of
'SpatRaster'
for a terra::SpatRaster object,'numeric'
for a matrix or array, or'dataframe'
for raster data suitable for plotting withggplot2::geom_raster()
Value
The return type of get_mask()
depends on the format
argument:
"SpatRaster"
(the default) returns a terra::SpatRaster object."numeric"
returns the mask as a matrix."dataframe"
will return a data frame suitable for plotting with ggplot2::geom_raster with columns:row
,col
the row and column indices of each cell.x
,y
the x and y coordinates of the cell center.i
the location index (inbf
) of the cell.mask
TRUE
for cells included in the model,FALSE
for excluded cells.