Unable to run meta package

For some reason the meta package (used for meta-analyses) will not run in the cloud version of RStudio. It works fine in RStudio on my laptop.
The error message is:

library(meta)
Error: package or namespace load failed for ‘meta’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘lme4’

When I try to install lme4 it also fails to load.

Any help would be gratefully received!

What is the error message that you get for lme4? Chances are that your package library is in a bad state. Nevertheless try

install.packages(lme4)

and then

library(lme4)
library(meta)

Thanks, but yes I tried that when I first got the error messages. When trying to install lme4, I get a long error message which I do not understand:
"> install.packages("lme4")
Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppEigen’
trying URL 'http://rspm/default/__linux__/focal/latest/src/contrib/RcppEigen_0.3.4.0.2.tar.gz'
trying URL 'http://rspm/default/__linux__/focal/latest/src/contrib/lme4_1.1-38.tar.gz'
ERROR: failed to lock directory ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.5’ for modifying
Try removing ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.5/00LOCK-RcppEigen’
Warning in install.packages :

  • installation of package ‘RcppEigen’ had non-zero exit status*
    ERROR: dependency ‘RcppEigen’ is not available for package ‘lme4’
    Perhaps try a variation of:
    install.packages('RcppEigen')
    ** removing ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.5/lme4’*
    Warning in install.packages :
  • installation of package ‘lme4’ had non-zero exit status*"

I have installed RcppEigen as the error mesage states, but lme4 still does not install.

This happened for all of my students also when using RStudio on the cloud. When using RStudio installed on our laptops it all works; none of these error message appear.

I'm not familiar with the cloud version, but this is saying you need to delete a file which is blocking the install:

Try removing ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.5/00LOCK-RcppEigen’

Bit of aside, but you might be interested to know that {meta} is available on webR which runs in the browser rather than the cloud e.g.:

That 00LOCK error is such a classic headache! I always forget that simply deleting that directory fixes 90% of installation fails on the cloud. Also, I hadn't thought about trying {meta} in webR - that's a really neat suggestion for a quick workaround.

Thanks for the messages. I've tried deleting the 00LOCK-RcppEigen directory and then installing lme4, but then RStudio disconnects and crashes. When I re-start, the 00LOCK-RcppEigen directory has miraculously re-appeared! lme4 fails to install every time, and so I can't run meta.

All very strange. I'll stick to using RStudio downloaded on my laptop. Thanks for the advice about webR. I'll take a look.

Thanks
Richard