Skip to content
Prev 61920 / 63421 Next

Recent changes to as.complex(NA_real_)

[..........]
and then, I end with
where really, I think we should keep that behavior (*), at least
for now: Changing it as well *does* have a relatively large
impact, is not back-compatible with (the long history of) S and
R, *and* it complicates documentation and teaching unnecessarily.

Experts will now how to differentiate the different complex NAs,
e.g. by using a simple utilities such as {"format complex", "print complex"}

  fc <- function(z) paste0("(",Re(z), ",", Im(z),")")
  pc <- function(z) noquote(fc(z))

which I've used now for testing/"visualizing" different scenarios


Martin


---
*) simply printing 'NA' in cases where is.na(.) is true and is.nan(.) is false