问题描述
在Ubuntu 18.04上从CRAN安装 lme4
软件包时遇到问题.我在R 3.4.4上运行 install.packages("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:链接:错误:没有有关变量'AR'的信息.libs/redblack.o .libs/qsort_r.o .libs/rescale.o
正在检查ranlib ...错误:没有有关变量"RANLIB"的信息
但是, ar
和 ranlib
命令都可以在我的计算机上使用.错误的原因可能是什么?
However, both ar
and ranlib
commands work on my machine. What may be the cause of the errors?
推荐答案
您只需要安装旧版本的nloptr软件包即可.
You just need to install the older version of nloptr package.
例如:
packageurl<-"https://cran.r-project.org/src/contrib/Archive/nloptr/nloptr_1.2.1.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
我猜您正在使用R3.X.此类错误是由支持R 4.0的软件包更新引起的.
I guess you are using R 3.X. Such error is caused by package update for supporting R 4.0.
这篇关于在Ubuntu上从CRAN安装lme4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!