[med-svn] [r-bioc-biocgenerics] 01/03: New upstream version 0.22.1

Andreas Tille tille at debian.org
Mon Oct 9 12:52:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-bioc-biocgenerics.

commit 34288c4d199a6506ce0b78e68ee8d39f8bc7c114
Author: Andreas Tille <tille at debian.org>
Date:   Mon Oct 9 14:51:07 2017 +0200

    New upstream version 0.22.1
---
 DESCRIPTION                    | 12 ++++----
 R/Extremes.R                   |  4 +++
 R/cbind.R                      |  2 ++
 R/hotfix73465.R                | 69 ++++++++++++++++++++++++++++++++++++++++++
 R/mapply.R                     |  1 +
 R/order.R                      |  1 +
 R/paste.R                      |  1 +
 inst/unitTests/test_Extremes.R | 14 +++++++++
 inst/unitTests/test_order.R    | 18 +++++++++++
 inst/unitTests/test_paste.R    | 12 ++++++++
 man/tapply.Rd                  |  4 +--
 man/xtabs.Rd                   |  5 +--
 12 files changed, 133 insertions(+), 10 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index a37a626..2ab222e 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: BiocGenerics
 Title: S4 generic functions for Bioconductor
 Description: S4 generic functions needed by many Bioconductor packages.
-Version: 0.22.0
+Version: 0.22.1
 Author: The Bioconductor Dev Team
 Maintainer: Bioconductor Package Maintainer <maintainer at bioconductor.org>
 biocViews: Infrastructure
@@ -11,10 +11,10 @@ Suggests: Biobase, S4Vectors, IRanges, GenomicRanges, AnnotationDbi,
         oligoClasses, oligo, affyPLM, flowClust, affy, DESeq2, MSnbase,
         annotate, RUnit
 License: Artistic-2.0
-Collate: S3-classes-as-S4-classes.R normarg-utils.R replaceSlots.R
-        append.R as.data.frame.R as.list.R as.vector.R cbind.R
-        do.call.R duplicated.R eval.R Extremes.R funprog.R get.R grep.R
-        is.unsorted.R lapply.R lengths.R mapply.R match.R
+Collate: S3-classes-as-S4-classes.R normarg-utils.R hotfix73465.R
+        replaceSlots.R append.R as.data.frame.R as.list.R as.vector.R
+        cbind.R do.call.R duplicated.R eval.R Extremes.R funprog.R
+        get.R grep.R is.unsorted.R lapply.R lengths.R mapply.R match.R
         matrix-summary.R mean.R nrow.R order.R paste.R rank.R rep.R
         row_colnames.R sets.R sort.R start.R subset.R t.R table.R
         tapply.R unique.R unlist.R unsplit.R relist.R var.R which.R
@@ -23,4 +23,4 @@ Collate: S3-classes-as-S4-classes.R normarg-utils.R replaceSlots.R
         fileName.R normalize.R organism_species.R plotMA.R plotPCA.R
         score.R strand.R updateObject.R testPackage.R zzz.R
 NeedsCompilation: no
-Packaged: 2017-04-24 23:11:07 UTC; biocbuild
+Packaged: 2017-10-06 05:26:47 UTC; biocbuild
diff --git a/R/Extremes.R b/R/Extremes.R
index acc8b20..bb8cbe2 100644
--- a/R/Extremes.R
+++ b/R/Extremes.R
@@ -16,10 +16,14 @@
 #setGeneric("min", signature="...")
 
 setGeneric("pmax", signature="...")
+apply_hotfix73465(getGeneric("pmax"))
 
 setGeneric("pmin", signature="...")
+apply_hotfix73465(getGeneric("pmin"))
 
 setGeneric("pmax.int", signature="...")
+apply_hotfix73465(getGeneric("pmax.int"))
 
 setGeneric("pmin.int", signature="...")
+apply_hotfix73465(getGeneric("pmin.int"))
 
diff --git a/R/cbind.R b/R/cbind.R
index c62ec44..ed55e21 100644
--- a/R/cbind.R
+++ b/R/cbind.R
@@ -8,6 +8,8 @@
 ### Note that dispatching on '...' is supported starting with R 2.8.0 only.
 
 setGeneric("cbind", signature="...")
+apply_hotfix73465(getGeneric("cbind"))
 
 setGeneric("rbind", signature="...")
+apply_hotfix73465(getGeneric("rbind"))
 
diff --git a/R/hotfix73465.R b/R/hotfix73465.R
new file mode 100644
index 0000000..66d2a1d
--- /dev/null
+++ b/R/hotfix73465.R
@@ -0,0 +1,69 @@
+### =========================================================================
+### apply_hotfix73465()
+### -------------------------------------------------------------------------
+###
+### The following regression was introduced in R 3.4.2 w.r.t. handling of the
+### ellipsis:
+###
+###     setGeneric("order", signature="...")
+###     x <- c(NA, 11:13)
+###     order(x, na.last=NA)          # [1] 2 3 4
+###     order_wrapper <- function(x, ...) order(x, ...)
+###     order_wrapper(x, na.last=NA)  # [1] 2 3 4 1
+###
+### This affects all the generics with dispatch on the ellipsis.
+###
+### Commit 72613 in R trunk fixes this but unfortunately was not backported
+### in time for R 3.4.2, only a few days later in R 3.4.2 Patched with commit
+### 73465.
+###
+### Commit 73465 only replaces the following code:
+###
+###     match.call(sys.function(sys.parent()), sys.call(sys.parent()),
+###                expand.dots=FALSE)
+###
+### with:
+###
+###     match.call(sys.function(sys.parent()), sys.call(sys.parent()),
+###                expand.dots=FALSE, envir=parent.frame(2))
+###
+### in methods:::.standardGenericDots
+###
+### The apply_hotfix73465() utility function below can be used to fix the
+### generics with dispatch on the ellipsis for users running R 3.4.2 or
+### R 3.4.2 Patched < r73465.
+###
+
+.patch_standardGenericsDots <- function(standardGenericDots)
+{
+    body <- body(standardGenericDots)
+
+    ## modify body
+    old_code <- "match.call(sys.function(sys.parent()), sys.call(sys.parent()), expand.dots=FALSE)"
+    new_code <- "match.call(sys.function(sys.parent()), sys.call(sys.parent()), expand.dots=FALSE, envir=parent.frame(2))"
+    stopifnot(identical(
+        as.call(parse(text=old_code)[[1L]]),
+        body[[7L]][[3L]])
+    )
+    body[[7L]][[3L]] <- as.call(parse(text=new_code)[[1L]])
+
+    body(standardGenericDots) <- body
+    standardGenericDots
+}
+
+### Fix order() generic with apply_hotfix73465(getGeneric("order")). Will
+### apply the fix only to users running R 3.4.2 or R 3.4.2 Patched < r73465.
+apply_hotfix73465 <- function(FUN)
+{
+    if (R.Version()[["major"]] != "3" || R.Version()[["minor"]] != "4.2")
+        return()
+    svn_rev <- as.integer(R.Version()[["svn rev"]])
+    if (svn_rev >= 73465)
+        return()
+    stopifnot(is(FUN, "standardGeneric"))
+    envir <- environment(FUN)
+    standardGenericsDots <- get("standardGeneric", envir=envir)
+    standardGenericsDots <- .patch_standardGenericsDots(standardGenericsDots)
+    assign("standardGeneric", standardGenericsDots, envir=envir)
+}
+
diff --git a/R/mapply.R b/R/mapply.R
index 9475fc0..82d5e66 100644
--- a/R/mapply.R
+++ b/R/mapply.R
@@ -9,4 +9,5 @@
 ### Note that dispatching on '...' is supported starting with R 2.8.0 only.
 
 setGeneric("mapply", signature="...")
+apply_hotfix73465(getGeneric("mapply"))
 
diff --git a/R/order.R b/R/order.R
index 6581b8f..19e416c 100644
--- a/R/order.R
+++ b/R/order.R
@@ -8,4 +8,5 @@
 ### Note that dispatching on '...' is supported starting with R 2.8.0 only.
 
 setGeneric("order", signature="...")
+apply_hotfix73465(getGeneric("order"))
 
diff --git a/R/paste.R b/R/paste.R
index f1639e9..e211654 100644
--- a/R/paste.R
+++ b/R/paste.R
@@ -8,4 +8,5 @@
 ### Note that dispatching on '...' is supported starting with R 2.8.0 only.
 
 setGeneric("paste", signature="...")
+apply_hotfix73465(getGeneric("paste"))
 
diff --git a/inst/unitTests/test_Extremes.R b/inst/unitTests/test_Extremes.R
new file mode 100644
index 0000000..aedb9ac
--- /dev/null
+++ b/inst/unitTests/test_Extremes.R
@@ -0,0 +1,14 @@
+
+test_ellipsis_forwarding_for_Extremes <- function()
+{
+    for (FUN in c("pmax", "pmin", "pmax.int", "pmin.int")) {
+        FUN <- match.fun(FUN)
+        FUN_wrapper <- function(x, ...) FUN(x, ...)
+        x <- c(1:3, NA)
+        y <- c(NA, 3:1)
+        checkIdentical(FUN(x, y), FUN_wrapper(x, y))
+        checkIdentical(FUN(x, y, na.rm=FALSE), FUN_wrapper(x, y, na.rm=FALSE))
+        checkIdentical(FUN(x, y, na.rm=TRUE), FUN_wrapper(x, y, na.rm=TRUE))
+    }
+}
+
diff --git a/inst/unitTests/test_order.R b/inst/unitTests/test_order.R
new file mode 100644
index 0000000..39c3952
--- /dev/null
+++ b/inst/unitTests/test_order.R
@@ -0,0 +1,18 @@
+
+test_ellipsis_forwarding_for_order <- function()
+{
+    x <- list(c(NA,11:13), c(21:22,NA))
+
+    target <- lapply(x, base::order)
+    checkIdentical(target, lapply(x, order))
+
+    target <- lapply(x, base::order, na.last=TRUE)
+    checkIdentical(target, lapply(x, order, na.last=TRUE))
+
+    target <- lapply(x, base::order, na.last=FALSE)
+    checkIdentical(target, lapply(x, order, na.last=FALSE))
+
+    target <- lapply(x, base::order, na.last=NA)
+    checkIdentical(target, lapply(x, order, na.last=NA))
+}
+
diff --git a/inst/unitTests/test_paste.R b/inst/unitTests/test_paste.R
new file mode 100644
index 0000000..1f35362
--- /dev/null
+++ b/inst/unitTests/test_paste.R
@@ -0,0 +1,12 @@
+
+test_ellipsis_forwarding_for_paste <- function()
+{
+    x <- list(letters, LETTERS)
+
+    target <- sapply(x, base::paste)
+    checkIdentical(target, sapply(x, paste))
+
+    target <- sapply(x, base::paste, collapse="")
+    checkIdentical(target, sapply(x, paste, collapse=""))
+}
+
diff --git a/man/tapply.Rd b/man/tapply.Rd
index f7fb50e..a508407 100644
--- a/man/tapply.Rd
+++ b/man/tapply.Rd
@@ -19,7 +19,7 @@
 }
 
 \usage{
-tapply(X, INDEX, FUN=NULL, ..., simplify=TRUE)
+tapply(X, INDEX, FUN=NULL, ..., default=NA, simplify=TRUE)
 }
 
 \arguments{
@@ -39,7 +39,7 @@ tapply(X, INDEX, FUN=NULL, ..., simplify=TRUE)
     Specific methods can support other objects (typically list-like).
     Please refer to the documentation of a particular method for the details.
   }
-  \item{FUN, ..., simplify}{
+  \item{FUN, ..., default, simplify}{
     See \code{?base::\link[base]{tapply}} for a description of
     these arguments.
   }
diff --git a/man/xtabs.Rd b/man/xtabs.Rd
index 0e50b05..2c74e7d 100644
--- a/man/xtabs.Rd
+++ b/man/xtabs.Rd
@@ -19,11 +19,12 @@
 
 \usage{
 xtabs(formula=~., data=parent.frame(), subset, sparse=FALSE, 
-      na.action, exclude=c(NA, NaN), drop.unused.levels=FALSE)
+      na.action, addNA=FALSE, exclude=if(!addNA)c(NA, NaN),
+      drop.unused.levels=FALSE)
 }
 
 \arguments{
-  \item{formula, subset, sparse, na.action, exclude, drop.unused.levels}{
+  \item{formula, subset, sparse, na.action, addNA, exclude, drop.unused.levels}{
     See \code{?stats::\link[stats]{xtabs}} for a description of
     these arguments.
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-bioc-biocgenerics.git



More information about the debian-med-commit mailing list