MathiasHarrer / Doing-Meta-Analysis-in-R

[Read-Only] All R code and source files for the online guide "Doing Meta-Analysis with R: A Hands-On Guide"

Home Page:https://www.protectlab.org/meta-analysis-in-r

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in sink(type = "output") : invalid connection - for Bayesian Meta-Analysis Model (12-bayesian-meta-analysis.Rmd line 132)

daaronr opened this issue · comments

For Bayesian Meta-Analysis Model, 12-bayesian-meta-analysis.Rmd, for the chunk on line 132, when I run it in Rstudio on my Mac (R version 3.6.2),

  • it twice prompts me to install developer tools. I say no because I've Xcode loaded
  • then it throws a complicated double-error (below)

Perhaps one needs to have Rstan installed for this to work?

Compiling the C++ model
running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file109b0711a3d53.cpp 2> file109b0711a3d53.cpp.err.txt' had status 1Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from <built-in>:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Dense:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Core:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new:85:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cs

Error in sink(type = "output") : invalid connection

Btw I love this guide, thanks!

Ok I sorted this out. It was all about the Rstan installation. Will try to remember to post the solution.

Would you mind posting the solution? Would be helpful to submit a pull request so we can get it working for others.

It was now so long ago that I'm not sure I can reconstruct it. I believe there was only one thing missing in the instructions I have linked, one thing that didn't work