#### Utilities from /u/sfs/R/Rprofile --- Martin Maechler #### #### You can add here, but *DO NOT* change existing definitions #### ------- ------------------- is.Lx.64 <- (R.version$arch == "x86_64") RrootDir <- file.path("/usr", if(is.Lx.64) "local64.sfs" else "local.sfs", "app/R/R_local") if(getRversion() < "2.9") { ## The "real" grepl() function has more arguments and is more powerful ## This is sufficient for a workaround for old R versions: grepl <- function (pattern, x, ...) { seq_along(x) %in% grep(pattern, x, ...) } } biofromR <- function(Rv = R.version) { M <- as.numeric(Rv$major) m <- as.integer(Rv$minor) # drop "z" in "x.y.z" sprintf("%.1f", M + (m - 5)/10) } ## BioCfromR <- ## ## R BioC ## c("2.0" = "1.5", ## "2.1" = "1.6", ## ........... ## "2.6" = "2.1", ## ........... ## "2.9" = "2.4", ## "2.10" = "2.5", # << ! thisBioC <- biofromR() ## BioCfromR[substr(RVersion, 1,3)] ##vvvvvvvvv this is used e.g. from /usr/local/app/R/Bioconductor/Update-me.R ## no longer needed (all clients are now on FC13: 2010-09-10) ## still needed for 32-bit (deb4 !): ## if(!is.Lx.64) if(FALSE) ## On Fedora 13 need some packages recompiled if(grepl("fc13", Sys.info()[["release"]])) thisBioC <- paste(thisBioC, "FC13", sep="_") libBioC <- paste("library", thisBioC, sep="_") biocLibrary <- file.path(dirname(RrootDir), "Bioconductor", libBioC) R.maj.ver <- function(Rv = R.version) { M <- as.numeric(Rv$major) m <- as.integer(Rv$minor) # drop "z" in "x.y.z" paste(M, m, sep=".") }