| Line 28... |
Line 28... |
| 28 |
the result is also \code{NA}. In either case, the expression
|
28 |
the result is also \code{NA}. In either case, the expression
|
| 29 |
\code{if(x == y)....} won't work as expected.
|
29 |
\code{if(x == y)....} won't work as expected.
|
| 30 |
|
30 |
|
| 31 |
The function \code{all.equal} is also sometimes used to test equality
|
31 |
The function \code{all.equal} is also sometimes used to test equality
|
| 32 |
this way, but it was intended for something different. First, it
|
32 |
this way, but it was intended for something different. First, it
|
| 33 |
tries to allow for ``reasonable'' differences in numeric results.
|
33 |
tries to allow for \dQuote{reasonable} differences in numeric results.
|
| 34 |
Second, it returns a descriptive character vector instead of
|
34 |
Second, it returns a descriptive character vector instead of
|
| 35 |
\code{FALSE} when the objects do not match. Therefore, it is not the
|
35 |
\code{FALSE} when the objects do not match. Therefore, it is not the
|
| 36 |
right function to use for reliable testing either. (If you \emph{do} want
|
36 |
right function to use for reliable testing either. (If you \emph{do} want
|
| 37 |
to allow for numeric fuzziness in comparing objects, you can combine
|
37 |
to allow for numeric fuzziness in comparing objects, you can combine
|
| 38 |
\code{all.equal} and \code{identical}, as shown in the examples
|
38 |
\code{all.equal} and \code{identical}, as shown in the examples
|