Description Usage Arguments Value Note Examples
defdMethods enumerates methods defined for a class in a package – NEEDS WORK
1 | defdMethods(cl, pkg = paste0("package:", cl), verbose = TRUE)
|
cl |
character(1) name of class |
pkg |
character(1) name of package where class is defined, defaults to 'package:classname' which works for major classes like SummarizedExperiment; |
verbose |
logical(1) if TRUE (default) will issue a message enumerating superclasses. |
a data.frame instance with columns 'method', 'cl', 'pkg', 'nmeth4cl', counting the number of method-signature combinations for this method, and 'sigs', a list of lists of named signature elements (each element is a list of character vectors of method parameter types, named with parameter names)
Users should consider how methods inherited from superclasses defined in other packages are also relevant to reports of this type. See the example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # start with simple tabulation of package-specific methods
suppressPackageStartupMessages({
require("SingleCellExperiment")
})
scem = defdMethods("SingleCellExperiment")
head(scem)
scem$method
scem["isSpike", "sigs"]
# now let's collect some related classes, with the objective of
# enumerating relevant coercion methods and their signatures
require("SummarizedExperiment")
se = defdMethods("SummarizedExperiment", verbose=FALSE)
rse = defdMethods("RangedSummarizedExperiment", "package:SummarizedExperiment", verbose=FALSE)
cmb = try(rbind(scem,se,rse))
require("dplyr")
require("magrittr")
tmp = (cmb %>% filter(method=="coerce"))
sl = (tmp %>% select(sigs))[[1]]
names(sl) = tmp$cl
sl
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.