Create directory and helper files for a Stan package using CmdStanR
setup_stan_package(loc = NULL, use_all = TRUE)
a file.path indicating package root.
a logical indicating if each section of Stan code
should have it's own directory with a default of TRUE
invisible null
# Create Temporary Directory
temp_dir <- tempdir()
# Now setup the structur
setup_stan_package(loc = temp_dir)
#> Creating directory structure
#> ℹ Place your Stan programs in the `inst/stan` directory
#> To reference Stan code in expanded directories use `#include
#> functions/func.stan syntax in the appropriate block`
# Examine output
list.files(temp_dir, recursive = TRUE)
#> [1] "R/staninside-helpers.R" "downlit/base" "downlit/remotes"
#> [4] "downlit/utils" "file1802232b5dd9" "functions/func.stan"
#> [7] "inst/stan/base.stan" "test.stan" "test2.stan"