Skip to content

Commit

Permalink
add input for stan r functions
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Aug 28, 2024
1 parent 1ada544 commit 3ec6d57
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
14 changes: 10 additions & 4 deletions R/pcd-stan-tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ pcd_stan_path <- function() {

#' List available Stan functions
#'
#' @inheritParams pcd_load_stan_functions
#' @return A character vector of available Stan function names
#' @export
#' @aliases pcd_stan_functions
pcd_stan_functions <- function() {
pcd_stan_functions <- function(
stan_path = primarycensoreddist::pcd_stan_path()) {
stan_files <- list.files(
pcd_stan_path(),
stan_path,
pattern = "\\.stan$", full.names = TRUE,
recursive = TRUE
)
Expand All @@ -37,6 +39,9 @@ pcd_stan_functions <- function() {
#' @param functions Character vector of function names to load. Defaults to all
#' functions.
#'
#' @param stan_path Character string, the path to the Stan code. Defaults to the
#' path to the Stan code in the primarycensoreddist package.
#'
#' @param wrap_in_block Logical, whether to wrap the functions in a
#' `functions{}` block. Default is FALSE.
#'
Expand All @@ -50,10 +55,11 @@ pcd_stan_functions <- function() {
#' @export
#' @aliases pcd_load_stan_functions
pcd_load_stan_functions <- function(
functions = NULL, wrap_in_block = FALSE, write_to_file = FALSE,
functions = NULL, stan_path = primarycensoreddist::pcd_stan_path(),
wrap_in_block = FALSE, write_to_file = FALSE,
output_file = "pcd_stan_functions.stan") {
stan_files <- list.files(
pcd_stan_path(),
stan_paths,
pattern = "\\.stan$", full.names = TRUE,
recursive = TRUE
)
Expand Down
4 changes: 4 additions & 0 deletions man/pcd_load_stan_functions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/pcd_stan_functions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ec6d57

Please sign in to comment.