Cmdstanr installation error

Hi, I updated my R version to 4.3.1 and have had to reinstall cmdstanr.

I use the code
install.packages(“cmdstanr”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))

and the error messages:
Installing package into ‘C:/Users/X/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
installing the source package ‘cmdstanr’

trying URL ‘https://mc-stan.org/r-packages/src/contrib/cmdstanr_0.6.1.tar.gz
Content type ‘application/gzip’ length 254213 bytes (248 KB)
downloaded 248 KB

  • installing source package ‘cmdstanr’ …
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘cmdstanr’:
    .onLoad failed in loadNamespace() for ‘cmdstanr’, details:
    call: if (endsWith(path, “/”)) {
    error: missing value where TRUE/FALSE needed
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘C:/Users/X/AppData/Local/R/win-library/4.3/cmdstanr’
    Warning in install.packages :
    installation of package ‘cmdstanr’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\X\AppData\Local\Temp\RtmpIpPoLQ\downloaded_packages’

Could you please take a look and help me with it?

Thank you!

I don’t know much about windows but this seems like the same error message from this issue:

Does anything discussed there help?

2 Likes

Yes, this is the same problem. After deleting the .cmdstan folder under /document, the package can be installed.

Thank you so much for your help!

2 Likes