EDIT :
Many thanks to user20650, whose answer solved this problem. But if anyone knows why the .Rprofile
file affects
sudo apt-get install r-base-dev
solved the problem for me
This was a bug, should be fixed by this commit in the development version (on Github) and in release 1.1-7 when it comes out (soon?)
This (possibly) may not be an answer to Richard's Q. but does replicate a problem i had installing lme4
on ubuntu 12,04
on Rv3.1
. It would be good if others could reproduce this.
So following on from my comment - noticing that Richard had a .Rprofile, defining .First
and .Last
in my .Rprofile
caused packages not to install.
Exmaple
First uninstall lme4
remove.packages("lme4")
Define .Rprofile file
## .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")
}
Open R
Try an install lme4
- no success & similar error to Richard's above
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
So rename (or remove) .Rprofile file in terminal
mv .Rprofile temp.Rprofile
Open R again and try to install 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
Based on your comments and expanded questions:
You are shooting yourself in the foot by installing R 3.1.0 onto Ubuntu 12.04.
You now run an R that is out of sync with packages like r-cran-lme4
in the distro.
The good news is that you can ask the distribution for information about the so-called Build-Depends it knows, and rebuild lme4 under R 3.1.0
Or can benefit from Michael's other work over at launchpad and use his other repo which is what eg the r-travis code does: sudo add-apt-repository -y "ppa:marutter/rrutter"
followed by and sudo add-apt-repository -y "ppa:marutter/c2d4u"
That last step will give you loads of pre-built packages. In the long run you are of course better off being to able to build packages from source yourself...