These functions take a model object and create the appropriate file in the
required location. If .source_file
argument is used, this file will be
copied to the location. Otherwise, a template "scaffold" of the required file
is created in that location. Note, this primarily intended for Stan
models which require several necessary files to run. (See ?
bbr_stan
for details about these files.) Users can call check_stan_model(.mod)
to
see if any of these files are missing.
add_stanmod_file(.mod, .source_file = NULL)
add_standata_file(.mod, .source_file = NULL)
add_staninit_file(.mod, .source_file = NULL)
add_stan_fitted_params_file(.mod, .source_file = NULL)
a bbi_{.model_type}_model
object
If NULL
, the default, create an empty scaffold file
at the destination path. If not NULL
, pass a path to a file that
will be copied to the destination path. Use this if you have a
file elsewhere on disk that you would like to use for this model.
add_stanmod_file()
: Adds a <run>.stan
model file.
add_standata_file()
: Adds a <run>-standata.R
file for building
the data. See ?
bbr_stan for details.
add_staninit_file()
: Adds a <run>-init.R
file for building the
initial values. See ?
bbr_stan for details.
add_stan_fitted_params_file()
: Adds a <run>-fitted-params.R
file that
prepares previously generated MCMC samples as input for a standalone
generated quantities run. See ?
bbr_stan for details.