Names of Slots Inherited From a Super Class

Share:

Description

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.

Usage

1

Arguments

Class

character string or classRepresentation, i.e., resulting from getClass.

where

environment, to be passed further to isClass and getClass.

Value

character vector of slot names, or NULL.

See Also

slotNames, slot, setClass, etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
.srch <- search()
library(stats4)
inheritedSlotNames("mle")

if(require("Matrix")) {
  print( inheritedSlotNames("Matrix") ) # NULL
  ## whereas
  print( inheritedSlotNames("sparseMatrix") ) # --> Dim & Dimnames
  ##  i.e. inherited from "Matrix" class

  print( cl <- getClass("dgCMatrix") ) # six slots, etc

  print( inheritedSlotNames(cl) ) # *all* six slots are inherited
}
## Not run: 


## detach package we've attached above:
for(n in rev(which(is.na(match(search(), .srch)))))
   try( detach(pos = n) )

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.