Thanks so much Hervé! That appears to have solved the problem. And I will
definitely keep in mind for the future Michael’s suggestion of duck typing for
matrix-like objects.
All of the best,
Elizabeth
> On Oct 10, 2018, at 9:33 PM, Hervé Pagès wrote:
>
> Hi Elizabeth,
>
> I agree that the
Hi Elizabeth,
I agree that the setClassUnion() warning is rather esoteric, especially
the "consider setClassUnion()" part.
library(DelayedArray)
setClassUnion("matrixOrHDF5", c("matrix", "DelayedArray"))
# Warning message:
# subclass "DelayedArray1" of class "DelayedArray" is not local
This underscores how setClassUnion() can lead to unintended consequences.
Inheritance is an extreme form of coupling, and subclasses are expected to
obey the contract specified by the super class. By defining a class union,
the developer is essentially inventing a contract without any commitment
Hello,
I am using `setClassUnion` in my package `clusterExperiment` in the following
code to allow for either matrix or DelayedArray:
setClassUnion("matrixOrHDF5",members=c("matrix", "DelayedArray"))
This causes the following warning in checking my package:
Warning: subclass "DelayedArray1"