Predict methods in ipmr
This function is used when a predict
method is incorporated
into the vital rate expressions of a kernel. Generally, ipmr can handle this
without any additional user effort, but some model classes will fail (often
with an obscure error message).
When this happens, use_vr_model
can ensure that model object is
correctly represented in the data_list
.
use_vr_model(model)
model |
A fitted model object representing a vital rate. Primarily used to avoid
writing the mathematical expression for a vital rate, and using a |
ipmr usually recognizes model objects passed into the data_list
argument
automatically. Unfortunately, sometimes it'll miss one, and the user will need
to manually protect it from the standard build process. This function
provides a wrapper around that process.
Wrap a model object in use_vr_model
when building the data_list
to pass to define_kernel
.
A model object with a "flat_protect"
attribute.
data(iceplant_ex) grow_mod <- lm(log_size_next ~ log_size, data = iceplant_ex) surv_mod <- glm(survival ~ log_size, data = iceplant_ex, family = binomial()) data_list <- list( grow_mod = use_vr_model(grow_mod), surv_mod = use_vr_model(surv_mod), recruit_mean = 20, recruit_sd = 5 )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.