> m3 <-brm(weight ~ Time, ChickWeight)
Compiling the C++ model
> m3
Error: object 'm3' not found
>m2 <- brm(f2 + f3 + set_rescor(FALSE), data = dat, chains= 1, cores = 1)
Compiling the C++ model
> m2
Error: object 'm2' not found
The brms variables containing the models are not in the R studio environment. Also, the variables are not found when typing:
traceback(m3)
Error in .is.positive.intlike(x) : object ‘m3’ not found
Operating System: Windows 10
brms Version: 2.13.0
R version: 4.02
EDIT: I can get the Stan running again in the above environment by using rstan 2.19.3 instead of the latest rstan 2.21.1. So there indeed seems to be a problem in the latest rstan.
Yes, reverting back to rstan 2.19.3 will fix the problem. As of now, rstan 2.21.1 is only available as source on CRAN so when you just uninstall rstan and install it again but then refuse to compile from source, it will give you rstan 2.19.3 directly. In a few days rstan 2.21.1 will also be available as compiled package in which case the approach above does not work anymore and you have to go for:
packageurl <- "http://cran.r-project.org/src/contrib/Archive/rstan/rstan_2.19.3.tar.gz"
install.packages(packageurl, repos = NULL, type = "source")
It would be nice to be notified when rstan is fixed, but I don’t know where to look for it.
Apparently, it seems that lots of topics have been opened, all of them pointing to the same problem, which makes it very difficult to follow.
Thank you for the suggestion. I have similar issues with brms after updating r and want to try reverting back to an earlier version of rstan. However, when I run the code you suggested, I get the following error. Any ideas of how to fix it? I tried googling but haven’t found a solution. Thanks!
restoring previous ‘C:/Users/Daphne Liu/Documents/R/win-library/4.0/rstan’
Warning in install.packages :
installation of package ‘C:/Users/DAPHNE~1/AppData/Local/Temp/RtmpCmzG1g/downloaded_packages/rstan_2.19.3.tar.gz’ had non-zero exit status
Hello,
I was having the same problem with Rstan version 2.12.2 not compiling and tried reverting to 2.19.3 with the code you sent but it gives me this error:
clang: warning: no such sysroot directory: ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk’ [-Wmissing-sysroot]
In file included from chains.cpp:19:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/arr/err/check_nonzero_size.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/meta.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/arr/meta/get.hpp:4:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/cstdlib:85:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/stdlib.h:93:15: fatal error: ‘stdlib.h’ file not found #include_next <stdlib.h>
^~~~~~~~~~
clang: warning: no such sysroot directory: ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk’ [-Wmissing-sysroot]
In file included from init.cpp:25:
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:47:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/cstdlib:85:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/stdlib.h:93:15: fatal error: ‘stdlib.h’ file not found #include_next <stdlib.h>
^~~~~~~~~~
1 error generated.
removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rstan’
Warning in install.packages :
installation of package ‘/var/folders/_v/_dp_x44j2_gb3fg47_bgdrxw0000gn/T//Rtmp0q7TYZ/downloaded_packages/rstan_2.19.3.tar.gz’ had non-zero exit status
I’m using macOS Catalina version 10.15.6
brms version: 2.13.5
R version: 3.6.0
restoring previous ‘D:/Documents/R/win-library/3.6/rstan’
Warning in install.packages :
installation of package ‘C:/Users/Alasdair/AppData/Local/Temp/RtmpYjZ4zU/downloaded_packages/rstan_2.19.3.tar.gz’ had non-zero exit status
Thanks for your help! I have everything nicely set up and working on my work Imac (which i’ve been working on all summer) and Win10 laptop. Now trying to get set up for the autumn on my home desktop, and running into all sorts of problems with the new versions of R, RTools, etc.
Alright, the first step is to tell R where to look for the compiler. You can do this by setting the BINPREF environment variable using a .Rprofile file. You can create this through R by running:
And, while i have your attention, is there a good, up-to-date guide about how to get things working on Win10, and what versions of are required? (All my problems started when I foolishly decided to update R to the current version!)
I’m going to be teaching Statistical Rethinking this academic term, and providing tech support to students is going to be a nightmare. [Grumble grumble about Covid closing the computer labs…]
But they could do with some coverage of common issues and how to resolve them. It’s been on my to-do-list for a little while, but I’ll try and get them updated over the next few days