Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to execute "expose_stan_functions(model_exposed_cached)" at line 68 in TITEPK_run.R on recent Rstan version #1

Open
axelvuorinen opened this issue Jul 18, 2023 · 0 comments

Comments

@axelvuorinen
Copy link

While trying to run the available code on the main executing R file (TITEPK_run.R), I wasn't able to run the expose_stan_functions line command to import functions written on Stan files into the R environment using R version 4.2.3 (2023-03-15) and rstan version 2.21.8 (StanHeaders_2.26.27). Instead of executing correctly, I got the following error :

Error: $ operator is invalid for atomic vectors

After discussing directly with Burak Günhan, it became clear that the problem was coming from the version of rstan and its dependencies and a solution was find using online ressource that already faced this problem : https://discourse.mc-stan.org/t/expose-stan-functions-not-working-after-updating-rstan-and-r/25569/20

The solution used to solve the issue was to run the following code lines to install another rstan version in which the issue is solved:
remove.packages(c("rstan", "StanHeaders"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant