Skip to content

Commit

Permalink
fix dir bug
Browse files Browse the repository at this point in the history
  • Loading branch information
n8thangreen committed Aug 13, 2024
1 parent 381dc2b commit 40e6dd5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/bmcm_stan.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@ compile_model <- function(use_cmdstanr,
if (use_cmdstanr) {
model_path <-
cmdstanr::write_stan_file(
model_code, dir = file_path, basename = model_name)
return(cmdstanr::cmdstan_model(stan_file = model_path, compile = TRUE))
model_code, dir = ".", basename = model_name)
return(
cmdstanr::cmdstan_model(
stan_file = model_path,
compile = TRUE,
dir = file_path))
} else {
out <- rstan::stan_model(model_code = model_code, model_name = model_name)
saveRDS(out, file = glue::glue("{file_path}/{model_name}.RDS"))
Expand Down

0 comments on commit 40e6dd5

Please sign in to comment.