A previous post prompted me to post this question. It would seem like a best-practice to reassign ==
to isTRUE(all.equal())
( and !=
to !isTRUE(all.equal())
. I'm wondering if others do this in practice? I just realized that I use ==
and !=
to do numeric equality throughout my codebase. My first reaction was that I need to do a full-scrub and convert to all.equal
. But in fact, everytime I use ==
and !=
I want to test equality (regardless of the datatype). In fact, I'm not sure what these operations would test for other than equality. I'm sure I'm missing some concept here. Can someone enlighten me? The only argument I see against this approach is that in some cases two non-identical numbers will appear to be identical because of the tolerance of all.equal
. But we're told that two numbers that are in fact identical might not pass identical()
because of how they are are stored in memory. So really what's the point of not defaulting to all.equal
?