编辑:
感谢user20650,他的回答解决了这个问题。但是,如果有人知道为什么 .Rprofile文件会影响Ubuntu12.04上的lme4安装,请告诉我,因为我真的很想知道。
原始帖子:
我正在尝试安装doBy包,并遇到了一些问题。它依赖于lme4,由于某种原因,它没有从我迄今尝试过的任何源编译。我已经访问过几个链接,包括这一个,但没有取得任何成功。
以下是我在安装过程中遇到的错误片段。我尝试了三种不同的方法,如下所述。如果lme4出了什么事,任何人都知道
尝试1:
> install.packages('doBy')
# ...
# ERROR: compilation failed for package ‘lme4’
# * removing ‘/home/richard/R/x86_64-pc-linux-gnu-library/3.1/lme4’
# Warning in install.packages :
# installation of package ‘lme4’ had non-zero exit status
#
# Successfully loaded .Rprofile at Wed May 21 13:33:34 2014
# ERROR: dependency ‘lme4’ is not available for package ‘doBy’
# * removing ‘/home/richard/R/x86_64-pc-linux-gnu-library/3.1/doBy’
# Warning in install.packages :
# installation of package ‘doBy’ had non-zero exit status尝试2:
> install.packages("lme4",repos = "http://r-forge.r-project.org")
# Installing package into ‘/home/richard/R/x86_64-pc-linux-gnu-library/3.1’
# (as ‘lib’ is unspecified)
# Warning in install.packages :
# package ‘lme4’ is not available (for R version 3.1.0)尝试3:
> install_github(repo = 'lme4/lme4', username = 'stevencarlislewalker')

运行Ubuntu 12.04 LTS
> version
# _
# platform x86_64-pc-linux-gnu
# arch x86_64
# os linux-gnu
# system x86_64, linux-gnu
# status
# major 3
# minor 1.0
# year 2014
# month 04
# day 10
# svn rev 65387
# language R
# version.string R version 3.1.0 (2014-04-10)
# nickname Spring Dance 发布于 2014-05-22 12:36:15
这(可能)可能不是理查德的问题的答案,但确实复制了我在ubuntu 12,04上Rv3.1上安装了一个问题。如果别人能复制这个,那就太好了。
因此,接下来我的评论-注意到理查德有一个.Rprofile,定义了.First和.Last在我的.Rprofile导致软件包没有安装。
Exmaple
首先卸载lme4
remove.packages("lme4")定义.Rprofile文件
## .First() run at the start of every R session.
.First <- function() {
cat("\nSuccessfully loaded your .Rprofile at", date(), "\n")
}
## .Last() run at the end of the session
.Last <- function() {
cat("\nGoodbye at ", date(), "\n")
}开放R
尝试安装lme4 -没有成功&类似于理查德上面的错误
install.packages("lme4")
...
* removing ‘/home/admin1/R/i686-pc-linux-gnu-library/3.1/lme4’
Warning in install.packages :
installation of package ‘lme4’ had non-zero exit status因此,在终端中重命名(或删除) .Rprofile文件
mv .Rprofile temp.Rprofile再次打开R并尝试安装lme4
install.packages("lme4")
...
* installing vignettes
** testing if installed package can be loaded
* DONE (lme4)
library(lme4)
# Loading required package: Matrix
# Loading required package: Rcpp发布于 2014-05-27 19:15:42
这是一个bug,应该由此承诺在开发版本中修复(在Github上),以及在1.1-7版本中(很快?)
发布于 2014-05-21 21:38:23
根据你的意见和扩大的问题:
r-cran-lme4 )不同步的R。sudo add-apt-repository -y "ppa:marutter/rrutter"和sudo add-apt-repository -y "ppa:marutter/c2d4u"。最后一步将为您提供大量预先构建的包。从长远来看,你最好能自己从源头上构建软件包.
https://stackoverflow.com/questions/23793870
复制相似问题