Create directory and helper files for a Stan package using CmdStanR

setup_stan_package(loc = NULL, use_all = TRUE)

Arguments

loc

a file.path indicating package root.

use_all

a logical indicating if each section of Stan code should have it's own directory with a default of TRUE

Value

invisible null

Examples


# 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"