[R] noncommutative addition: NA+NaN != NaN+NA

Robin Hankin rksh at soc.soton.ac.uk
Tue Sep 7 11:17:21 CEST 2004


Hi guys.

Check this out:

>  NaN +NA
[1] NaN
>  NA + NaN
[1] NA

I thought "+" was commutative by definition.   What's going on?

>  R.version
          _
platform powerpc-apple-darwin6.8
arch     powerpc
os       darwin6.8
system   powerpc, darwin6.8
status
major    1
minor    9.0
year     2004
month    04
day      12
language R
>

(Both give NA under linux, so it looks like a version-specific issue).


-- 
Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
initialDOTsurname at soc.soton.ac.uk (edit in obvious way; spam precaution)




More information about the R-help mailing list