References Adding Local R Libraries Custom Settings in .Renviron
Total Page:16
File Type:pdf, Size:1020Kb
R References Adding local R libraries Custom settings in .Renviron package ‘N’ is not available (for R version X ) Bioconductor Running R scripts Installing R module from source Setting default cran mirror Using R commander Using R with qsub R studio R with fast BLAS Rmpi snow snowfall References http://biosun1.harvard.edu/~paciorek/computingTips/Libraries_in_R.html http://rss.acs.unt.edu/Rdoc/library/base/html/Startup.html http://cran.r-project.org/doc/manuals/R-admin.html http://www.stat.osu.edu/computer-support/mathstatistics-packages/installing-r-libraries-locally-your-home-directory http://www.biostat.jhsph.edu/bit/R-personal-library.html http://www.umich.edu/~gpcc/scs/R.html Adding local R libraries instructions written for compile.vcu.edu when using a cluster, get a shell on a compute node using qrsh ssh with X tunnelling enabled. ssh -X <account>@<server> which might look like: ssh -X [email protected] Custom settings in .Renviron If running R on a server that has the /tmp directory set to noexec for security reasons, the TMP varible can set R to use an alterantive. Do the following to set use a subdirectory of your home directory. mkdir ~/Rtmp; echo "TMP=/home/<account>/Rtmp" >> .Renviron R install.packages("ggplot2", dependencies = TRUE) install.packages("gmodels", dependencies = TRUE) install.packages("gplot", dependencies = TRUE) install.packages("prettyR", dependencies = TRUE) install.packages("xtable", dependencies = TRUE) install.packages("Hmisc", dependencies = TRUE) install.packages("memisc", dependencies = TRUE) install.packages("gplots", dependencies = TRUE) install.packages("RGtk2", dependencies = TRUE) install.packages("Rcmdr", dependencies = TRUE) NOTE: When selecting a CRAN repository, if an https site fails, use an http site instead. NOTE: If installation of a package fails when using automatic mirror site selection, try using a specific mirror, as below: install.packages("png", dependencies = TRUE, repos='http://cran.rstudio.com/' ) Show all search paths R is aware of when looking for modules: .libPaths() Show temp directory which R is currently using: tempdir() Show all installed modules R is using: library() package ‘N’ is not available (for R version X ) If you get this error message while trying to install a package, it may be because you are trying to make an https connection from a computer with ssl too old to support newer ssl connections. Try http connection instead: > install.packages("N", dependencies = TRUE ) Installing package into ‘/home/cgchildr/Rlibs’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- Error in download.file(url, destfile = f, quiet = TRUE) : unsupported URL scheme HTTPS CRAN mirror 1: 0-Cloud [https] 2: Austria [https] 3: Chile [https] 4: China (Beijing 4) [https] 5: Colombia (Cali) [https] 6: France (Lyon 2) [https] 7: France (Paris 2) [https] 8: Germany (Münster) [https] 9: Iceland [https] 10: Mexico (Mexico City) [https] 11: Russia (Moscow) [https] 12: Spain (A Coruña) [https] 13: Switzerland [https] 14: UK (Bristol) [https] 15: UK (Cambridge) [https] 16: USA (CA 1) [https] 17: USA (KS) [https] 18: USA (MI 1) [https] 19: USA (TN) [https] 20: USA (TX) [https] 21: USA (WA) [https] 22: (HTTP mirrors) Selection: 19 Warning: unable to access index for repository https://mirrors.nics.utk.edu/cran/src/contrib: unsupported URL scheme Warning message: package ‘N’ is not available (for R version X) Restart R, to clear previous repository, the chose an http repository: > install.packages("WGCNA", dependencies = TRUE ) Installing package into ‘/home/cgchildr/Rlibs’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- Error in download.file(url, destfile = f, quiet = TRUE) : unsupported URL scheme HTTPS CRAN mirror 1: 0-Cloud [https] 2: Austria [https] 3: Chile [https] 4: China (Beijing 4) [https] 5: Colombia (Cali) [https] 6: France (Lyon 2) [https] 7: France (Paris 2) [https] 8: Germany (Münster) [https] 9: Iceland [https] 10: Mexico (Mexico City) [https] 11: Russia (Moscow) [https] 12: Spain (A Coruña) [https] 13: Switzerland [https] 14: UK (Bristol) [https] 15: UK (Cambridge) [https] 16: USA (CA 1) [https] 17: USA (KS) [https] 18: USA (MI 1) [https] 19: USA (TN) [https] 20: USA (TX) [https] 21: USA (WA) [https] 22: (HTTP mirrors) Selection: 22 HTTP CRAN mirror 1: 0-Cloud 2: Algeria 3: Argentina (La Plata) 4: Australia (Canberra) 5: Australia (Melbourne) 6: Austria 7: Belgium (Antwerp) 8: Belgium (Ghent) 9: Brazil (BA) 10: Brazil (PR) 11: Brazil (RJ) 12: Brazil (SP 1) 13: Brazil (SP 2) 14: Canada (BC) 15: Canada (NS) 16: Canada (ON) 17: Chile 18: China (Beijing 2) 19: China (Beijing 3) 20: China (Beijing 4) 21: China (Xiamen) 22: Colombia (Cali) 23: Czech Republic 24: Denmark 25: Ecuador 26: El Salvador 27: Estonia 28: France (Lyon 1) 29: France (Lyon 2) 30: France (Marseille) 31: France (Montpellier) 32: France (Paris 1) 33: France (Paris 2) 34: Germany (Berlin) 35: Germany (Göttingen) 36: Germany (Münster) 37: Greece 38: Hungary 39: Iceland 40: India 41: Indonesia (Jakarta) 42: Iran 43: Ireland 44: Italy (Milano) 45: Italy (Padua) [https] 46: Italy (Padua) 47: Italy (Palermo) 48: Japan (Tokyo) 49: Japan (Yamagata) 50: Korea (Seoul 1) 51: Korea (Seoul 2) 52: Korea (Ulsan) 53: Lebanon 54: Mexico (Mexico City) 55: Mexico (Texcoco) 56: Mexico (Queretaro) 57: Netherlands (Amsterdam) 58: Netherlands (Utrecht) 59: New Zealand 60: Norway 61: Philippines 62: Poland 63: Russia (Moscow) 64: Singapore 65: Slovakia 66: South Africa (Cape Town) 67: South Africa (Johannesburg) 68: Spain (A Coruña) 69: Spain (Madrid) 70: Sweden 71: Switzerland 72: Taiwan (Chungli) 73: Taiwan (Taipei) 74: Thailand 75: Turkey (Denizli) 76: Turkey (Mersin) 77: UK (Bristol) 78: UK (Cambridge) 79: UK (London 1) 80: UK (London 2) 81: UK (St Andrews) 82: USA (CA 1) 83: USA (CA 2) 84: USA (CO) 85: USA (IA) 86: USA (IN) 87: USA (KS) 88: USA (MI 1) 89: USA (MI 2) 90: USA (MO) 91: USA (NC) 92: USA (OH 1) 93: USA (OH 2) 94: USA (OR) 95: USA (PA 2) 96: USA (TN) 97: USA (TX) 98: USA (WA) 99: Venezuela Selection: 96 The module should then download and compile successfully. Bioconductor Some R modules used for bioinformatics are not located in CRAN but are found in the Bioconductor repository. Researching the modules should confirm if this is the case. If so follow these directions to install from biocoductor. CRAN modules may also be required. https://www.bioconductor.org/install/ Running R scripts http://stackoverflow.com/questions/18306362/run-r-script-from-command-line Installing R module from source http://stackoverflow.com/questions/1474081/how-do-i-install-an-r-package-from-source Setting default cran mirror http://my.safaribooksonline.com/book/programming/r/9780596809287/navigating-the-software/recipe- id272#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODA1OTY4MDkyODcvNjE= Using R commander A basic gui for R http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/ http://www.rcommander.com/index.php/index.php/installationrcmdr.html Using R with qsub http://www.biostat.jhsph.edu/bit/cluster-usage.html#TwoSteps R studio Rstudio is a graphic program. If you install it on one of our server you will have poor performance when using a network connection, particularly off campus. Use Rstudio locally to create R script then run them on the cluster. R with fast BLAS https://docs.google.com/a/vcu.edu/document/d/1D_HLuD-3DBSVFeNz0QnR0qrZEay4f1Ogsq2xbXUFqxA/edit?pli=1 http://www.tacc.utexas.edu/tacc-projects/gotoblas2/ Rmpi http://blog.nguyenvq.com/blog/2010/01/20/scheduled-parallel-computing-with-r-r-rmpi-openmpi-sun-grid-engine-sge/ http://permalink.gmane.org/gmane.comp.lang.r.hpc/614 https://www.sharcnet.ca/help/index.php/Using_R_and_MPI http://cran.r-project.org/web/views/HighPerformanceComputing.html http://math.acadiau.ca/ACMMaC/Rmpi/index.html http://www.open-mpi.org/community/lists/users/2011/10/17658.php http://www.cybaea.net/Blogs/R-tips-Installing-Rmpi-on-Fedora-Linux.html http://www.gridengine.eu/gridengineaddons/112-using-r-project-with-grid-engine-and-open-mpi install.packages("Rmpi", dependencies = TRUE, configure.args="--with-mpi=/usr/global/openmpi-1.5.3-w-psm/" ) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/global/openmpi-1.5.3-w-psm/lib export MPI_ROOT=/usr/global/openmpi-1.5.3-w-psm/ OMPI_MCA_mtl=^psm R > install.packages("Rmpi", dependencies = TRUE) New compile: module load openmpi-x86_64 mpirun -V R --version export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/lib64/openmpi/lib/" R > install.packages("Rmpi", dependencies = TRUE, configure.args= c("--with-Rmpi-include=/usr/include/openmpi-x86_64/", "--with-Rmpi-libpath=/usr/lib64/openmpi/lib/", "--with-Rmpi-type=OPENMPI")) testing: library("Rmpi") mpi.spawn.Rslaves(nslaves=2) x <- c(10,20) mpi.apply(x,runif) godel: source /usr/global/openmpi-1.5.3-w-psm/openmpi_env.sh source /usr/global/R-3.0.2/R_env.sh mpicc -show mpirun -V R --version export OMPI_MCA_mtl=^psm R > install.packages("Rmpi", dependencies = TRUE, configure.args= c("--with-Rmpi-include=/usr/global/openmpi-1.5.3-w-psm/include/", "--with-Rmpi-libpath=/usr/global/openmpi-1.5.3-w-psm/lib/", "--with-Rmpi-type=OPENMPI")) snow > install.packages("snow", dependencies = TRUE ) snow and sprng 2.0 http://r.789695.n4.nabble.com/sprng-2-0-header-file-for-Rmpi-td1559751.html may only work with R for Windows. snowfall > install.packages("snowfall", dependencies = TRUE ).