data(gen_di_det_ex)
proto <- gen_di_det_ex$proto_ipm
# Create a new, iterated IPM
new_ipm <- make_ipm(proto, iterate = TRUE,
iterations = 100, return_all_envs = TRUE)
vital_rate_exprs(new_ipm)
kernel_formulae(new_ipm)
vital_rate_funs(new_ipm)
domains(new_ipm)
parameters(new_ipm)
# Usage is the same for proto_ipm's as *_ipm's
vital_rate_exprs(proto)
kernel_formulae(proto)
domains(proto)
parameters(proto)
int_mesh(new_ipm)
# Setting new parameters, vital rate expressions, and kernel formulae
# only works on proto_ipm's.
# This replaces the "g_int" parameter and leaves the rest untouched
parameters(proto) <- list(g_int = 1.5)
# This creates a new g_z parameter and leaves the rest of parameters untouched
parameters(proto) <- list(g_z = 2.2)
# setting a new vital rate or kernel expression requires wrapping the
# right-hand side in a call to new_fun_form(). new_fun_form uses expressions
# with the same format as ... in define_kernel()
vital_rate_exprs(proto,
kernel = "P",
vital_rate = "g_mu") <- new_fun_form(g_int + g_z + g_slope * ht_1)
kernel_formulae(proto, kernel = "stay_discrete") <- new_fun_form(g_z * d_ht)
Run the code above in your browser using DataLab