Last chance! 50% off unlimited learning
Sale ends in
For a class (or class definition, see getClass
and
the description of class '>classRepresentation
),
give the names which are inherited from “above”, i.e., super
classes, rather than by this class' definition itself.
inheritedSlotNames(Class, where = topenv(parent.frame()))
character string or
'>classRepresentation
, i.e., resulting from
getClass
.
character vector of slot names, or NULL
.
# NOT RUN {
.srch <- search()
library(stats4)
inheritedSlotNames("mle")
if(require("Matrix")) withAutoprint({
inheritedSlotNames("Matrix") # NULL
## whereas
inheritedSlotNames("sparseMatrix") # --> Dim & Dimnames
## i.e. inherited from "Matrix" class
cl <- getClass("dgCMatrix") # six slots, etc
inheritedSlotNames(cl) # *all* six slots are inherited
})
# }
# NOT RUN {
<!-- % currently, don't do this when running all examples: classes remain -->
<!-- % cached anyway : -->
## detach package we've attached above:
for(n in rev(which(is.na(match(search(), .srch)))))
try( detach(pos = n) )
# }
# NOT RUN {
<!-- % end{dontrun} -->
# }
Run the code above in your browser using DataLab