View source: R/sar_countryside.R
countryside_extrap | R Documentation |
Use a fitted model object from sar_countryside() to predict richness, given a set of habitat area values.
countryside_extrap <- function(fits, area)
fits |
A fitted model object from |
area |
A vector of area values - the number (and order)
of area values (i.e., the length of the vector) should match
the number (and order) of habitats in the dataset used in
the |
Takes a model fit generated using
sar_countryside
and uses it to predict
richness values for a set of user-provided habitat
area
values. Note this can either be interpolated or
extrapolated predictions, depending on the range of area
values used in the original model fits. A ubiquitous model
prediction is included if a ubiquitous component model is
included in fits
.
The habitat area values provided through area
need to
be in the same order as the habitat columns in the original
dataset used in sar_countryside
.
The function does work with failed component model fits, as long as at least one component model was successfully fitted. However, arguably it does not make sense to predict richness values unless all component models were successfully fitted.
A list with three elements. The first contains the
predicted richness values from the individual component
models. The second contains the predicted total richness of
the site (i.e., the summed component model predictions), and
the third is a logical value highlighting whether there were
any failed models in fits
, i.e., component models
that could not be fitted in sar_countryside
.
Thomas J. Matthews
## Not run:
data(countryside)
#Fit the sar_countryside model (power version)
s3 <- sar_countryside(data = countryside, modType = "power",
gridStart = "partial", ubiSp = TRUE, habNam = c("AG", "SH",
"F"), spNam = c("AG_Sp", "SH_Sp", "F_Sp", “UB_Sp”))
#Predict the richness of a site which comprises 1000 area units
#of agricultural land, 1000 of shrubland and 1000 of forest.
countryside_extrap(s3, area = c(1000, 1000, 1000))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.