The R Project SVN R

Rev

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

Rev 26000 Rev 33556
Line 11... Line 11...
11
}
11
}
12
\usage{
12
\usage{
13
setClassUnion(name, members, where)
13
setClassUnion(name, members, where)
14
isClassUnion(Class)
14
isClassUnion(Class)
15
}
15
}
16
%- maybe also 'usage' for other objects documented here.
-
 
17
\arguments{
16
\arguments{
18
  \item{name}{ the name for the new union class. }
17
  \item{name}{ the name for the new union class. }
19
  \item{members}{ the classes that should be members of this union.}
18
  \item{members}{ the classes that should be members of this union.}
20
  \item{where}{ where to save the new class definition; by default,
19
  \item{where}{ where to save the new class definition; by default,
21
      the environment of the package in which the \code{setClassUnion}
20
      the environment of the package in which the \code{setClassUnion}
Line 71... Line 70...
71
  \url{http://developer.r-project.org/methodsPackage.html} and the
70
  \url{http://developer.r-project.org/methodsPackage.html} and the
72
  pointers from that page.
71
  pointers from that page.
73
}
72
}
74
 
73
 
75
\examples{
74
\examples{
76
 
-
 
77
## a class for either numeric or logical data
75
## a class for either numeric or logical data
78
setClassUnion("maybeNumber", c("numeric", "logical"))
76
setClassUnion("maybeNumber", c("numeric", "logical"))
79
 
77
 
80
## use the union as the data part of another class
78
## use the union as the data part of another class
81
setClass("withId", representation("maybeNumber", id = "character"))
79
setClass("withId", representation("maybeNumber", id = "character"))