Closed andrjohns closed 2 years ago
Hey, Thanks for working on this!
Removal of src
and stanmodels.R
seems to cause problems though. Can they be left in there? Do I need to adjust my workflow for it to work this way? I guess I don't know how to let rstantools handle this part.
When I try to run any of the models (e.g. devtools::test()
) it complains about missing stanmodels
Error in `h(simpleError(msg, call))`: error in evaluating the argument 'object' in selecting a method for function 'sampling': object 'stanmodels' not found
Ah of course, I should have clarified. With the src
and stanmodels.R
removals, these are now generated on package installation/building by rstantools
- this is what the configure
and configure.win
files take care of.
To recreate this locally (i.e., for running tests and similar), you just need to call rstantools::rstan_config()
- this will then create the src
and stanmodels.R
files. Apologies for not including that in the original post!
We're recommending this approach so that any changes to rstan
requiring config changes will automatically be managed by rstantools
, which will help simplify changes in the future
I see, that works. Thanks for your help! I'll delete those files for my other RStan-base package (surveil) too.
This PR contains some minor changes to make your package compatible with the upcoming RStan 2.26. I've removed the
src
folder andstanmodels.R
file, as these are fully handled byrstantools
.I've also made a small change to the
model.stan
file, where therep_vector(mu_x_true[j], n)
argument is first assigned to a temporary vector before being passed to theauto_normal_lpdf
likelihood. This is due to some transition issues when using the olderrstan
with the newerStanHeaders
, and can be reverted once the newer versions of both are on CRAN.Feel free to let me know if you had any questions!