| Line 51... |
Line 51... |
| 51 |
type: like \code{\link{as.vector}} it strips attributes including
|
51 |
type: like \code{\link{as.vector}} it strips attributes including
|
| 52 |
names.
|
52 |
names.
|
| 53 |
Since \R version 4.4.0, \code{as.complex(x)} for \dQuote{number-like}
|
53 |
Since \R version 4.4.0, \code{as.complex(x)} for \dQuote{number-like}
|
| 54 |
\code{x}, i.e., types \code{"logical"}, \code{"integer"}, and
|
54 |
\code{x}, i.e., types \code{"logical"}, \code{"integer"}, and
|
| 55 |
\code{"double"}, will always keep imaginary part zero, now also for
|
55 |
\code{"double"}, will always keep imaginary part zero, now also for
|
| 56 |
\code{NA}'s.
|
56 |
\code{NA}s.
|
| 57 |
Up to \R versions 3.2.x, all forms of \code{NA} and \code{NaN}
|
57 |
Up to \R versions 3.2.x, all forms of \code{NA} and \code{NaN}
|
| 58 |
were coerced to a complex \code{NA}, i.e., the \code{\link{NA_complex_}}
|
58 |
were coerced to a complex \code{NA}, i.e., the \code{\link{NA_complex_}}
|
| 59 |
constant, for which both the real and imaginary parts are \code{NA}.
|
59 |
constant, for which both the real and imaginary parts are \code{NA}.
|
| 60 |
Since \R 3.3.0, typically only objects which are \code{NA} in parts
|
60 |
Since \R 3.3.0, typically only objects which are \code{NA} in parts
|
| 61 |
are coerced to complex \code{NA}, but others with \code{NaN} parts,
|
61 |
are coerced to complex \code{NA}, but others with \code{NaN} parts,
|
| 62 |
are \emph{not}. As a consequence, complex arithmetic where only
|
62 |
are \emph{not}. As a consequence, complex arithmetic where only
|
| 63 |
\code{NaN}'s (but no \code{NA}'s) are involved typically will
|
63 |
\code{NaN}s (but no \code{NA}s) are involved typically will
|
| 64 |
\emph{not} give complex \code{NA} but complex numbers with real or
|
64 |
\emph{not} give complex \code{NA} but complex numbers with real or
|
| 65 |
imaginary parts of \code{NaN}.
|
65 |
imaginary parts of \code{NaN}.
|
| 66 |
All of these many different complex numbers fulfill \code{is.na(.)} but
|
66 |
All of these many different complex numbers fulfill \code{is.na(.)} but
|
| 67 |
only one of them is identical to \code{NA_complex_}.
|
67 |
only one of them is identical to \code{NA_complex_}.
|
| 68 |
|
68 |
|