This function facilitates the exposure of Stan functions from
the epinowcast package in R. It utilizes the expose_functions()
method
of cmdstanr::CmdStanModel or this purpose. This function is useful for
developers and contributors to the epinowcast package, as well as for
users interested in exploring and prototyping with model functionalities.
Usage
enw_stan_to_r(
files = list.files(include),
include = system.file("stan", "functions", package = "epinowcast"),
global = TRUE,
verbose = TRUE,
...
)
Arguments
- files
A character vector specifying the names of Stan files to be exposed. These must be in the
include
directory. Defaults to all Stan files in theinclude
directory. Note that the following files contain overloaded functions and cannot be exposed: "delay_lpmf.stan", "allocate_observed_obs.stan", "obs_lpmf.stan", and "effects_priors_lp.stan".- include
A character string specifying the directory containing Stan files. Defaults to the 'stan/functions' directory of the
epinowcast()
package.- global
A logical value indicating whether to expose the functions globally. Defaults to
TRUE
. Passed to theexpose_functions()
method of cmdstanr::CmdStanModel.- verbose
Logical, defaults to
TRUE
. Should verbose messages be shown.- ...
Additional arguments passed to enw_model.
See also
Functions used to help convert models into the format required for stan
enw_formula_as_data_list()
,
enw_get_cache()
,
enw_model()
,
enw_pathfinder()
,
enw_priors_as_data_list()
,
enw_replace_priors()
,
enw_sample()
,
enw_set_cache()
,
enw_unset_cache()
,
remove_profiling()
,
write_stan_files_no_profile()