customize_model | R Documentation |
Allows for efficient editing of model code produced by nimbleCode()
function
customize_model( model, append_code = NULL, append_line = NULL, remove_line = NULL, write = FALSE )
model |
The |
append_code |
Either |
append_line |
Either |
remove_line |
Either |
write |
Logical. If |
A model description that can be run using run_classic
.
Daniel Eacker
# get model scr_model = get_classic(dim_y = 2, enc_dist = "binomial",sex_sigma = TRUE, hab_mask=TRUE,trapsClustered = TRUE) # create new nimbleCode to use for replacement in 'scr_model' p0_prior = nimble::nimbleCode({ p0[g] ~ dbeta(1,1) }) # replace line 3 of old model code with 'p0_prior' new_model = customize_model(model = scr_model, append_code = p0_prior, append_line = 3, remove_line = 3) # inspect new model code new_model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.