View source: R/model_abundance.R
model_abundance | R Documentation |
Calculates the predicted abundance by multiplying the density prediction values by prediction polygon areas
model_abundance(x, dens.idx, sum.abund = TRUE)
x |
object of class |
dens.idx |
name or index of column(s) in |
sum.abund |
logical; whether or not to sum all of the predicted abundances |
Multiplies the values in the specified column(s) (i.e. the density predictions)
by the area in square kilometers of their corresponding prediction polygon.
The area of each prediction polygon is calculated using st_area
from geos_measures
.
x must have a valid crs code to calculate area for these abundance calculations.
If sum.abund == TRUE
, then a vector of the same length as dens.idx
representing the predicted abundance for the density values in each column.
If sum.abund == FALSE
and the length of dens.idx
is 1,
then a numeric vector with the predicted abundance of each prediction polygon of x
.
If sum.abund == FALSE
and the length of dens.idx
is greater than 1,
then a data frame with length(dens.idx)
columns of the predicted abundance of prediction polygons
model_abundance(preds.1, "Density")
model_abundance(preds.1, c(1, 1))
model_abundance(preds.1, c(1, 1), FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.