Is there a way to include functions written with write_stan_file()
using cmdstanr? Specifically when written to dir = tempdir()
?
Say I wrote a stan file called stan_funcs_file
using write_stan_file()
as below:
stan_funcs <- "functions { }"
stan_funcs_file <- write_stan_file(stan_funcs)
Is there any way to call it as an include from another stan file using cmdstanr_model
from the default dir = tempdir()
? I am confused about the appropriate syntax.
I also have a problem with how I write the include in the main model code.
When I try to add the include # include stan_funcs_file.stan
I get the error Comments beginning with # are deprecated.