问题
I am having difficulty installing the lme4 and ggplot packages
I've tried to install them by selecting a CRAN mirror (have tried several) and then selecting the packages, and have also tried the following;
install.packages("lme4",repos="http://r-forge.r-project.org")
and
install.packages("ggplot2", dependencies=TRUE)
but however I try to call these packages I get the warning message
package ‘lme4’ is not available (for R version 2.15.2)
or
package ‘ggplot2’ is not available (for R version 2.15.2)
the only answers I can find for problems installing these packages suggest upgrading R to the latest version, but I am using 2.15.2 which I believe is the most recent available.
Has anyone else had this problem?
Any help would be greatly appreciated!!
thanks.
Lian
回答1:
I was having the exact same problem. Here is what solved it for me:
For convenience I added a default cran mirror in my Rprofile.site
file:
local({r <- getOption("repos")
r["CRAN"] <- "http://cran.stat.sfu.ca/"
options(repos=r)})
Then installing packages in this order works:
install.packages("Matrix")
install.packages("nlme")
install.packages("minqa")
install.packages("RcppEigen")
install.packages("lme4",repos="http://lme4.r-forge.r-project.org/repos")
install.packages("ggplot2", dependencies=TRUE)
Hope it works for you as well.
回答2:
These packages should work fine, maybe try a few more mirrors, for example the one in Austria. Although there are packages who have been thrown of CRAN, e.g. the colorout package has been off CRAN for some time. The solution is to download the package from CRAN manually, and install locally.
来源:https://stackoverflow.com/questions/14663702/problems-installing-ime4-and-ggplot2-on-r-2-15-2