0

When executing the code:

N <- 100 # 500, 5000, 25000, 100000
x <- rnorm(N, mean = 6, sd = 2)
y <- rnorm(N, mean = x, sd = 1)
data <- list(x = x, y = y, N = N)

inla(y ~ x,
  family = "gaussian",
  data = data,
  control.predictor = list(link = 1),
  verbose=TRUE
  )

I get the following error:

dyld: Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/INLA/bin/mac/64bit/inla
  Reason: Incompatible library version: inla requires version 4.0.0 or later, but libR.dylib provides version 3.5.0
dyld: Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/INLA/bin/mac/64bit/inla
  Reason: Incompatible library version: inla requires version 4.0.0 or later, but libR.dylib provides version 3.5.0
Error in inla.inlaprogram.has.crashed() : 
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <help@r-inla.org>.

I have tried updating RStudio, as well as installing all package updates. Do anyone have suggestion for what to try next?

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 4
    It looks like your using R version 3.5 and you need version 4.0 or greater. Try updating R, which is different to RStudio. If you have more than one version of R installed, there should be a dropdown in the top right hand corner of the RStudio window that lets you select the active version. Make sure that's set to 4.0 or higher. – Limey May 28 '21 at 13:42
  • Restating: RStudio != R. The former is an integrated development environment (IDE) that runs whatever version of the R language/interpreter it can find. It does not include R. Upgrading one of the two has little direct effect on the other (except that if R is upgraded, RStudio may start using the different version once it is restarted). – r2evans May 28 '21 at 14:19
  • Regardless, I think you will need to re-install (upgrade?) the r-inla packages. – r2evans May 28 '21 at 14:22
  • Selecting the correct version of R in RStudio worked, thanks! – KKhello May 31 '21 at 13:42

0 Answers0