The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 74459
Line 1... Line 1...
1
% File src/library/methods/man/inheritedSlotNames.Rd
1
% File src/library/methods/man/inheritedSlotNames.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 2009-2014 R Core Team
3
% Copyright 2009-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{inheritedSlotNames}
6
\name{inheritedSlotNames}
7
\alias{inheritedSlotNames}
7
\alias{inheritedSlotNames}
8
\title{Names of Slots Inherited From a Super Class}
8
\title{Names of Slots Inherited From a Super Class}
Line 23... Line 23...
23
    \code{\link{isClass}} and \code{\link{getClass}}.}
23
    \code{\link{isClass}} and \code{\link{getClass}}.}
24
}
24
}
25
\value{
25
\value{
26
  character vector of slot names, or \code{\link{NULL}}.
26
  character vector of slot names, or \code{\link{NULL}}.
27
}
27
}
28
 
-
 
29
\seealso{
28
\seealso{
30
  \code{\link{slotNames}}, \code{\link{slot}}, \code{\link{setClass}}, etc.
29
  \code{\link{slotNames}}, \code{\link{slot}}, \code{\link{setClass}}, etc.
31
}
30
}
32
\examples{
31
\examples{
33
.srch <- search()
32
.srch <- search()
34
library(stats4)
33
library(stats4)
35
inheritedSlotNames("mle")
34
inheritedSlotNames("mle")
36
 
35
 
37
if(require("Matrix")) {
36
if(require("Matrix")) withAutoprint({
38
  print( inheritedSlotNames("Matrix") ) # NULL
37
  inheritedSlotNames("Matrix")       # NULL
39
  ## whereas
38
  ## whereas
40
  print( inheritedSlotNames("sparseMatrix") ) # --> Dim & Dimnames
39
  inheritedSlotNames("sparseMatrix") # --> Dim & Dimnames
41
  ##  i.e. inherited from "Matrix" class
40
  ##  i.e. inherited from "Matrix" class
42
 
-
 
43
  print( cl <- getClass("dgCMatrix") ) # six slots, etc
41
  cl <- getClass("dgCMatrix")        # six slots, etc
44
 
-
 
45
  print( inheritedSlotNames(cl) ) # *all* six slots are inherited
42
  inheritedSlotNames(cl) # *all* six slots are inherited
46
}
43
})
47
\dontrun{
44
\dontrun{
48
% currently, don't do this when running all examples: classes remain
45
% currently, don't do this when running all examples: classes remain
49
% cached anyway :
46
% cached anyway :
50
## detach package we've attached above:
47
## detach package we've attached above:
51
for(n in rev(which(is.na(match(search(), .srch)))))
48
for(n in rev(which(is.na(match(search(), .srch)))))