View source: R/ensemble_create.R
ensemble_create | R Documentation |
Create a weighted or unweighted ensemble of SDM predictions, including associated uncertainty values
ensemble_create(x, x.idx, w = NULL, x.var.idx = NULL, ...)
## S3 method for class 'sf'
ensemble_create(x, x.idx, w = NULL, x.var.idx = NULL, ...)
## S3 method for class 'data.frame'
ensemble_create(x, x.idx, w = NULL, x.var.idx = NULL, ...)
x |
object of class |
x.idx |
vector of column names or numerical indices;
indicates which columns in |
w |
weights for the ensemble; either a numeric vector the same length as |
x.var.idx |
vector of column names or column indices;
indicates columns in |
... |
Arguments to be passed to methods; specifically designed for passing
|
ensemble_create
is designed to be used after overlaying predictions with overlay_sdm
and
(if desired) rescaling the overlaid predictions with ensemble_rescale
.
This function implements ensemble methods provided in eSDM_GUI. Note that it does not implement regional exclusion, which must be done manually if not using the GUI.
Ensemble uncertainty is calculated using either the within-model uncertainty (if x.var.idx
is specified) or
the among-model uncertainty (if x.var.idx
is NULL
).
See the eSDM GUI manual for applicable formulas.
An object of the same class as x
with two columns appended to the data frame:
'Pred_ens' - The ensemble predictions
'Var_ens' - The variance of the ensemble predictions,
calculated using either the within-model uncertainty (if x.var.idx
is specified) or
the among-model uncertainty (if x.var.idx
is NULL
)
Note that all other columns of x
will be included in the returned object.
Also, if x
is of class sf
then
1) the geometry list-column will be the last column of the returned object and
2) the agr
attribute will be set as 'constant' for 'Pred_ens' and 'Var_ens'
ensemble_create(preds.1, c("Density", "Density2"), c(0.2, 0.8))
ensemble_create(preds.1, 1:2, c(0.2, 0.8), c("Var1", "Var2"))
ensemble_create(data.frame(a = 1:5, b = 3:7), c(1, 2))
weights.df <- data.frame(runif(325), c(rep(NA, 100), runif(225)))
ensemble_create(preds.1, c("Density", "Density2"), weights.df, na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.