Remove one or more compiled Stan models from the file system of an R package.

stan_package_clean(models = instantiate::stan_package_model_files())

Arguments

models

Character vector of file paths to Stan model source code files. Defaults to the Stan files in ./src/stan/ because all the Stan model files must live in the src/stan/ folder for an R package built with instantiate.

Value

NULL (invisibly). Called for its side effects.

Examples

if (identical(Sys.getenv("INSTANTIATE_EXAMPLES"), "true")) {
path <- tempfile()
stan_package_create(path = path)
stan_package_configure(path = path)
models <- stan_package_model_files(path)
list.files(file.path(path, "inst", "stan"))
stan_package_compile(models)
list.files(file.path(path, "inst", "stan"))
# Clean up the compiled Stan model files:
stan_package_clean(models = models)
list.files(file.path(path, "inst", "stan"))
}