R

How to add packages to your local repository

Depending on the packages you want installed, you can do one of two things within R. First we load the R module and run R:
[abc123@login-0-0 ]$ qlogin
[abc123@compute056 ]$ module load R
[abc123@compute056 ]$ R

For BioConductor packages, type the following:
source("https://bioconductor.org/biocLite.R")
biocLite()

Install specific packages, e.g., “GenomicFeatures” and “AnnotationDbi”, with
biocLite(c("GenomicFeatures", "AnnotationDbi"))

The biocLite() function (in the BiocInstaller package installed by the biocLite.R script) has arguments that change its default behavior; type ?biocLite for further help. For more information regarding the BioConductor package, please visit their Installation website here https://www.bioconductor.org/install/

For CRAN packages, type the following:
install.packages(c("package_name"))

R submit script
#!/bin/bash
#
#$ -N Name_of_job
#S -q all.q
#$ -cwd
#$ -j y
#$ -o $JOB_ID.log
#$ -pe threaded 20
. /etc/profile.d/modules.sh
# Load one of these
module load R/3.4.0
#module load rstudio/1.0.143
R -e "source('Script_Simulation_2_15_65.R')"

Your R input file must contain the parallel() section for parallel execution of R binaries to work properly. Here is an example:

require(parallel); require(mvtnorm); set.seed(2000)
cat('Cores: ', detectCores(), '\n')

-- AdminUser - 26 Jul 2017
Topic revision: r2 - 15 Sep 2017, AdminUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding UTSA Research Support Group? Send feedback