| 20620 |
jmc |
1 |
\name{makeClassRepresentation}
|
|
|
2 |
\alias{makeClassRepresentation}
|
| 23531 |
hornik |
3 |
\title{Create a Class Definition}
|
| 15357 |
jmc |
4 |
\description{
|
| 23531 |
hornik |
5 |
Constructs a \code{\link{classRepresentation-class}} object to
|
|
|
6 |
describe a particular class. Mostly a utility function, but you can
|
|
|
7 |
call it to create a class definition without assigning it, as
|
|
|
8 |
\code{\link{setClass}} would do.
|
| 15357 |
jmc |
9 |
}
|
|
|
10 |
\usage{
|
| 20620 |
jmc |
11 |
makeClassRepresentation(name, slots=list(), superClasses=character(),
|
| 23531 |
hornik |
12 |
prototype=NULL, package, validity, access,
|
| 26093 |
jmc |
13 |
version, sealed, virtual=NA, where)
|
| 15357 |
jmc |
14 |
}
|
|
|
15 |
\arguments{
|
| 23531 |
hornik |
16 |
\item{name}{character string name for the class}
|
|
|
17 |
\item{slots}{named list of slot classes as would be supplied to
|
|
|
18 |
\code{setClass}, but \emph{without} the unnamed arguments for
|
|
|
19 |
superClasses if any.}
|
|
|
20 |
\item{superClasses}{what classes does this class extend}
|
|
|
21 |
\item{prototype}{an object providing the default data for the class,
|
|
|
22 |
e.g, the result of a call to \code{\link{prototype}}.}
|
|
|
23 |
\item{package}{The character string name for the package in which
|
|
|
24 |
the class will be stored; see \code{\link{getPackageName}}.}
|
| 20620 |
jmc |
25 |
\item{validity}{Optional validity method. See
|
| 23531 |
hornik |
26 |
\code{\link{validObject}}, and the discussion of validity methods in
|
|
|
27 |
the reference.}
|
|
|
28 |
\item{access}{Access information. Not currently used.}
|
|
|
29 |
\item{version}{Optional version key for version control. Currently
|
|
|
30 |
generated, but not used.}
|
|
|
31 |
\item{sealed}{Is the class sealed? See \code{\link{setClass}}.}
|
|
|
32 |
\item{virtual}{Is this known to be a virtual class?}
|
| 26093 |
jmc |
33 |
|
|
|
34 |
\item{where}{The environment from which to look for class
|
|
|
35 |
definitions needed (e.g., for slots or superclasses). See the
|
|
|
36 |
discussion of this argument under \link{GenericFunctions}.}
|
| 15357 |
jmc |
37 |
}
|
|
|
38 |
\references{
|
| 25118 |
hornik |
39 |
The R package \pkg{methods} implements, with a few exceptions, the
|
| 23531 |
hornik |
40 |
programming interface for classes and methods in the book
|
|
|
41 |
\emph{Programming with Data} (John M. Chambers, Springer, 1998), in
|
|
|
42 |
particular sections 1.6, 2.7, 2.8, and chapters 7 and 8.
|
| 15357 |
jmc |
43 |
|
| 25118 |
hornik |
44 |
While the programming interface for the \pkg{methods} package follows
|
|
|
45 |
the reference, the R software is an original implementation, so
|
|
|
46 |
details in the reference that reflect the S4 implementation may appear
|
| 20620 |
jmc |
47 |
differently in R. Also, there are extensions to the programming
|
|
|
48 |
interface developed more recently than the reference. For a
|
| 23531 |
hornik |
49 |
discussion of details and ongoing development, see the web page
|
| 20620 |
jmc |
50 |
\url{http://developer.r-project.org/methodsPackage.html} and the
|
|
|
51 |
pointers from that page.
|
| 15357 |
jmc |
52 |
}
|
| 23531 |
hornik |
53 |
\seealso{
|
|
|
54 |
\code{\link{setClass}}
|
|
|
55 |
}
|
| 15357 |
jmc |
56 |
\keyword{programming}
|
|
|
57 |
\keyword{classes}
|