2011年10月23日 星期日

How to install R packages from source on Mac OS X



In R terminal :

install.packages("file_name_and_path", repos = "http://...", type="source")
install.packages("file_name_and_path", repos = NULL, type="source")


In unix terminal :

R CMD INSTALL package_name.tar.gz

Check that R is properly installed :

$ which R
/usr/bin/R

Install the package :

$ sudo R CMD INSTALL package_name.tgz

Check that everything is happy :

$ ls -l /Library/Frameworks/R.framework/Resources/library/