Short summary of the problem
I am trying to model with stan in R but I am running into multiple errors which after a few hours I am at a loss on how to progress. I try installing cmdstan:
install_cmdstan(
dir = NULL,
cores = getOption("mc.cores", 2),
quiet = FALSE,
overwrite = FALSE,
timeout = 1200,
version = NULL,
release_url = NULL,
cpp_options = list(),
check_toolchain = TRUE
)
I then get an error:
Error:
Rtools42 installation found but the toolchain was not installed.
Run cmdstanr::check_cmdstan_toolchain(fix = TRUE) to fix the issue.
I then run the suggested code to try and fix the issue:
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
Installing mingw32-make and g++ with Rtools42.
Error in processx::run("pacman", args = c("-Sy", install_pkgs, "--noconfirm"), …
:
! System command ‘pacman’ failed
Exit status: 1
Stderr:
error: failed to synchronize all databases (unable to lock database)
I am not really sure how to proceed or remedy this issue. I tried consulting this post (Trouble with cmdstan toolchain with RTools42 on Windows 10 Enterprise) but was unable to fix the problem.
- Operating System:
Windows 11 - RStan Version:
2.26.13 - Output of
writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))
Error in file(con, “r”) : cannot open the connection
In addition: Warning message:
In file(con, “r”) :
cannot open file ‘C:/Users/willi/Documents/.R/Makevars’: No such file or directory - Output of
devtools::session_info("rstan")
setting value
version R version 4.2.2 (2022-10-31 ucrt)
os Windows 10 x64 (build 22000)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.utf8
ctype English_United States.utf8
tz America/New_York
date 2022-12-02
rstudio 2022.07.1+554 Spotted Wakerobin (desktop)
pandoc 2.18 @ C:/Program Files/RStudio/bin/quarto/bin/tools/ (via rmarkdown)