Thursday, March 27, 2014

R Language Installation


http://en.wikipedia.org/wiki/R_%28programming_language%29

How to install R on CentOS 6:
> sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

> sudo yum install R
 
Useful IDE:
http://www.rstudio.com/ide/download/desktop 

How to install packages for all users:

Part 1/3: First, run R as root

Launch R with sudo R, and enter your password.

Part 2/3: To install everything, just paste this single long line in R:

(Note that these packages will still NOT be available to all users until we fix it in part 3/3, because the default root permissions forbid other users from reading the installed packages.)
source("http://www.bioconductor.org/biocLite.R") ; biocLite() ; biocLite("limma",dependencies=TRUE); biocLite("statmod"); biocLite("ADaCGH", dependencies=TRUE); biocLite("arrayQuality"); biocLite("affxparser"); biocLite("makecdfenv"); biocLite("affycomp"); biocLite("multtest",dependencies=TRUE); biocLite("Genominator",dependencies=TRUE); biocLite("affy"); biocLite("HTqPCR");
install.packages(c("Agi4x44PreProcess", "aroma.affymetrix", "bitops", "caTools", "cluster", "CNTools", "cgh", "DBI", "digest", "DESeq", "getopt", "genefilter", "geneplotter", "gplots", "gtools", "grid", "gridBase", "GLAD", "GO.db", "hopach", "Hmisc", "hexbin", "IRanges", "KernSmooth", "KEGG.db", "mgcv", "methods", "matrixStats", "Matrix", "MASS", "marray", "nnet", "nlme", "org.Hs.eg.db", "preprocessCore", "pixmap", "parser", "qvalue", "qtl", "rpart", "R.huge", "R.filesets", "RColorBrewer", "RSQLite", "sandwich", "sets", "simpleaffy", "snapCGH", "spatial", "splines", "stats4", "strucchange", "survival", "tilingArray", "tcltk", "topGO", "vsn", "xterm256"), dependencies=TRUE);

Part 3/3: Finally, fix the permissions (required step!)

Now, if you installed things for all users using the sudo R command up above, you have an easy-to-solve problem---the new scripts aren't readable! They are installed by default into/usr/local/lib/R/. So you want to make everything there world-readable, and the directories world-exectuable (exectuable for directories means "can be looked at using ls").
If you skip this step, things will still work for YOU, but they will break for all other users.
Solution:
sudo chmod -R a+r /usr/local/lib/R ; sudo find /usr/local/lib/R -type d | sudo xargs chmod a+x
Now you're done installing the R package!

================

 If you want to  build your own R with the source from http://cran.rstudio.com/ make sure you do the followint to install the  required font:
- download the current package from 
http://mirrors.ctan.org/systems/texlive/tlnet/archive/inconsolata.tar.xz

- locate your personal texmf directory by

kpsewhich -var-value=TEXMFHOME

usually ~/texmf (and it may need to be created) and cd there.

- install the current version by something like

tar xf inconsolata.tar.xz

or use untar('inconsolata.tar.xz') in R;

(if there is an ls-R file in that directory, run

mktexlsr .

) then

sudo updmap --enable Map=zi4.map

No comments: