This compiles the models needed for the artemis package. This must be done before using the eDNA_lm* functions. This function is called for its side-effects.

compile_models(
  model_names = c("eDNA_lm.stan", "eDNA_lmer.stan", "eDNA_sim_omni.stan"),
  models = system.file("stan", model_names, package = "artemis"),
  cache_dir = getOption("artemis_cache_dir", R_user_dir("artemis", "cache")),
  rewrite = TRUE,
  verbose = TRUE,
  ...
)

Arguments

model_names

the names of the models to compile

models

full file path to the location of models

cache_dir

a directory to store the Stan model code and compiled models. Can be set with the option "artemis_cache_dir", otherwise defaults to the directory returned by R_user_dir(). If the directory does not exist, it will be created.

rewrite

logical, whether to re-compile the models, overwriting previous versions.

verbose

logical, if TRUE messages will report steps being taken

...

additional arguments passed to cmdstanr::cmdstan_model()

Author

Matt Espe