3

I am having trouble installing the lme4 package. install.packages("lme4") issues the below warnings. When I try to load lme4, R says that it is non-existent. Does anyone know how to address this?

also installing the dependency `nloptr`

Warning message in install.packages("lme4"):
“installation of package ‘nloptr’ had non-zero exit status”
Warning message in install.packages("lme4"):
“installation of package ‘lme4’ had non-zero exit status”
Updating HTML index of packages in '.Library'
    
Making 'packages.html' ... done
Mikael Jagan
  • 9,012
  • 2
  • 17
  • 48
jean10
  • 151
  • 6
  • 1
    Can you run `install.packages("nloptr")` and copy and paste the _full_ output into your question? It would also help to see the output of `sessionInfo()`. You can find a related thread [here](https://stackoverflow.com/questions/70881723). You may just need to install or update CMake, but how you would do that is platform-dependent. – Mikael Jagan Feb 10 '22 at 05:04

2 Answers2

1

You should consider sudo apt install r-cran-lme4 as the lme4 is of course part of every Debian and Ubuntu release, has been since 2004. And that does of course include its dependencies, and eg nloptr has been in Debian and Ubuntu since 2014. (Disclosure: I maintain both for Debian).

More generally, you may also consider binaries for Ubuntu. I just answered a similar question yesterday with a nice 'gif video' of how installing the gmm package off the r2u repository with its 20,000 CRAN binaries for Ubuntu is something you may want to consider.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
-1

lme4 is trying to install a dependency nloptr, nloptr does need an external dependency to be installed called cmake, this could be why an installation of lme4 is failing.

If you capture the error of the package installation, you might see something like this:


CMake was not found on the PATH. Please install CMake:

 - sudo yum install cmake          (Fedora/CentOS; inside a terminal)
 - sudo apt install cmake          (Debian/Ubuntu; inside a terminal).
 - sudo pacman -S cmake            (Arch Linux; inside a terminal).
 - sudo brew install cmake         (MacOS; inside a terminal with Homebrew)
 - sudo port install cmake         (MacOS; inside a terminal with MacPorts)

Alternatively install CMake from: <https://cmake.org/>

You can try one of the options above, depending on your operating system.

iquestionshard
  • 956
  • 1
  • 7
  • 17