get.models.Rd
Generate or extract a list of fitted model objects from a
"model.selection"
table or component models from the averaged model
("averaging"
object), optionally using parallel computation in a
cluster.
get.models(object, subset, cluster = NA, ...)
object returned by dredge, model.sel or model.avg.
subset of models, an expression evaluated within the model selection table (see ‘Details’).
optionally, a "cluster"
object. If it is a valid
cluster, models are evaluated using parallel computation.
additional arguments to update the models. For example, one
may want to fit models with REML (e.g. argument
REML = TRUE
in some modelling functions) while using
ML for model selection.
list of fitted model objects.
The argument subset
must be explicitely provided. This is to assure that
a potentially long list of models is not fitted unintentionally. To evaluate all
models, set subset
to NA
or TRUE
.
If subset
is a character vector, it is interpreted as names of rows to be
selected.
"model.selection"
tables created by model.sel
or averaged models
created by model.avg
from a list of model objects (as opposed to those
created with model selection tables) store the component models as part of the
object - in these cases get.models
simply extracts the items from
these lists. Otherwise the models have to be fitted. Therefore, using
get.models
following dredge
is not efficient as the
requested models are fitted twice. If the number of generated models is
reasonable, consider using lapply(dredge(..., evaluate = FALSE), eval)
,
which generates a list of all model calls and evaluates them into a list of
model objects.
Alternatively, getCall
and eval
can be used to compute a model out of the
"model.selection"
table (e.g. eval(getCall(<model.selection>, i))
, where
i
is the model index or name).
pget.models
is still available, but is deprecated.
dredge and pdredge, model.avg
makeCluster in packages parallel and snow