The R Project SVN R

Rev

Rev 20092 | Rev 42333 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
19087 jmc 1
\name{BasicClasses}
2
\docType{class}
3
\alias{character-class}
4
\alias{complex-class}
5
\alias{double-class}
6
\alias{expression-class}
20092 jmc 7
\alias{externalptr-class}
19087 jmc 8
\alias{integer-class}
9
\alias{list-class}
10
\alias{logical-class}
11
\alias{numeric-class}
12
\alias{single-class}
13
\alias{vector-class}
14
\alias{NULL-class}
15
\alias{function-class}
16
\alias{ANY-class}
17
\alias{VIRTUAL-class}
18
\alias{missing-class}
19
\title{Classes Corresponding to Basic Data Types }
23531 hornik 20
\description{
21
  Formal classes exist corresponding to the basic R data types, allowing
22
  these types to be used in method signatures, as slots in class
23
  definitions, and to be extended by new classes.}
19087 jmc 24
\usage{
25
### The following are all basic vector classes.
26
### They can appear as class names in method signatures,
27
### in calls to as(), is(), and new().
28
"character"
29
"complex"
30
"double"
31
"expression"
32
"integer"
33
"list"
34
"logical"
35
"numeric"
36
"single"
37
 
38
### the class
39
"vector"
40
### is a virtual class, extended by all the above
41
 
42
### The following are additional basic classes
43
"NULL"     #  NULL objects
44
"function" #  function objects, including primitives
20092 jmc 45
"externalptr" # raw external pointers for use in C code
19087 jmc 46
 
47
"ANY"  # virtual classes used by the methods package itself
48
"VIRTUAL"
49
"missing"
50
}
51
\section{Objects from the Classes}{
23531 hornik 52
  Objects can be created by calls of the form \code{new(Class, ...)},
53
  where \code{Class} is the quoted class name, and the remaining
54
  arguments if any are objects to be interpreted as vectors of this
55
  class.  Multiple arguments will be concatenated.
19087 jmc 56
 
23531 hornik 57
  The class \code{"expression"} is slightly odd, in that the \dots
58
  arguments will \emph{not} be evaluated; therefore, don't enclose them
59
  in a call to \code{quote()}.
19087 jmc 60
}
61
\section{Extends}{
23531 hornik 62
  Class \code{"vector"}, directly.
19087 jmc 63
}
64
\section{Methods}{
65
  \describe{
66
    \item{coerce}{Methods are defined to coerce arbitrary objects to
67
      these classes, by calling the corresponding basic function, for
68
      example, \code{as(x, "numeric")} calls \code{as.numeric(x)}. }
69
  }
70
}
71
\keyword{classes}