The R Project SVN R

Rev

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

Rev 61810 Rev 61812
Line 31... Line 31...
31
  \code{numeric} is identical to \code{\link{double}} (and \code{real}).
31
  \code{numeric} is identical to \code{\link{double}} (and \code{real}).
32
  It creates a double-precision vector of the specified length with each
32
  It creates a double-precision vector of the specified length with each
33
  element equal to \code{0}.
33
  element equal to \code{0}.
34
 
34
 
35
  \code{as.numeric} is a generic function, but S3 methods must be
35
  \code{as.numeric} is a generic function, but S3 methods must be
36
  written for \code{\link{as.double}}.  It is identical to
36
  written for \code{\link{as.double}}.  It is identical to \code{as.double}.
37
  \code{as.double} (and \code{as.real}).
-
 
38
 
37
 
39
  \code{is.numeric} is an \link{internal generic} \code{primitive}
38
  \code{is.numeric} is an \link{internal generic} \code{primitive}
40
  function: you can write methods to handle specific classes of objects,
39
  function: you can write methods to handle specific classes of objects,
41
  see \link{InternalMethods}.  It is \strong{not} the same as
40
  see \link{InternalMethods}.  It is \strong{not} the same as
42
  \code{\link{is.double}}.  Factors are handled by the default method,
41
  \code{\link{is.double}}.  Factors are handled by the default method,
Line 60... Line 59...
60
}
59
}
61
\section{S4 methods}{
60
\section{S4 methods}{
62
  \code{as.numeric} and \code{is.numeric} are internally S4 generic and
61
  \code{as.numeric} and \code{is.numeric} are internally S4 generic and
63
  so methods can be set for them \emph{via} \code{setMethod}.
62
  so methods can be set for them \emph{via} \code{setMethod}.
64
 
63
 
65
  To ensure that \code{as.numeric}, \code{as.double} and \code{as.real}
64
  To ensure that \code{as.numeric} and \code{as.double}
66
  remain identical, S4 methods can only be set for \code{as.numeric}.
65
  remain identical, S4 methods can only be set for \code{as.numeric}.
67
}
66
}
68
%% keep next the same in double.Rd & numeric.Rd
67
%% keep next the same in double.Rd & numeric.Rd
69
\section{Note on names}{
68
\section{Note on names}{
70
  It is a historical anomaly that \R has two names for its
69
  It is a historical anomaly that \R has two names for its