Hi everyone,
I’m new to brms package while I have used R for some years. After installation of the brms package by following the instructions in the link https://github.com/paul-buerkner/brms, I cannot run through the example code in the help file of the brm().
The error message is:
Compiling the C++ model
Trying to compile a simple C file
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Error in file(con, “r”) : cannot open the connection
Calls: -> .shlib_internal -> checkCXX -> readLines -> file
In addition: Warning messages:
1: In file(con, “r”) :
‘raw = FALSE’ but ‘/Users/yaoxin/.R/Makevars’ is not a regular file
2: In file(con, “r”) :
cannot open file ‘/Users/yaoxin/.R/Makevars’: it is a directory
Execution halted
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file273c09ece.cpp 2> file273c09ece.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection
rror in compileCode(f, code, language = language, verbose = verbose) :
The example code I used that from the help file of the brm() is:
bprior1 <- prior(student_t(5,0,10), class = b) +
prior(cauchy(0,2), class = sd)
fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient),
data = epilepsy, family = poisson(), prior = bprior1)
I checked following things after checking some latest and hot topic in this website, which are:
- I have uninstalled old version of clang by following messages in this link Brms/rstan on R 4.0
- I also checked situations that posted in this topic Issue compiling Stan on R 4.0 / Catalina and this topic Problem running Rstan 2.19.3 in R version 4.0.1
- I have installed the Xcode with the latest version, clang 8 and commandlinetools. The Mac system of my computer also is on the latest version.
- Now, the folder /Users/yaoxin/.R/Makevars is empty.
My operating system: macOS Catalina version 10.15.5
brms version I used: 2.13.0
R version I used: 4.0.1
Thank you very much if anyone could give some helpful suggestions about my problem.