Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install lme4 from CRAN on Ubuntu

Tags:

r

lme4

I'm having trouble installing the lme4 package from CRAN on Ubuntu 18.04. I'm running install.packages("lme4") on R 3.4.4 and get the following error:

ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/3.4/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/3.4/lme4’

Looking more closely, I see these two error lines:

libtool: link: ERROR: no information for variable 'AR' cru .libs/libutil.a .libs/mt19937ar.o .libs/sobolseq.o .libs/timer.o .libs/stop.o .libs/redblack.o .libs/qsort_r.o .libs/rescale.o

checking for ranlib... ERROR: no information for variable 'RANLIB'

However, both ar and ranlib commands work on my machine. What may be the cause of the errors?

like image 595
pete Avatar asked Jul 14 '20 17:07

pete


1 Answers

You just need to install the older version of nloptr package.

For example:

packageurl<-"https://cran.r-project.org/src/contrib/Archive/nloptr/nloptr_1.2.1.tar.gz"

install.packages(packageurl, repos=NULL, type="source")

I guess you are using R 3.X. Such error is caused by package update for supporting R 4.0.

like image 80
YWu Avatar answered Nov 20 '22 15:11

YWu