[Rd] Date class shows Inf as NA; this confuses the use of is.na()

Gabe Becker becker@g@be @ending from gene@com
Wed Jun 13 18:20:16 CEST 2018


I see what you mean, but on the other hand, that's not how we think about
real numbers working either, and doubles have that behavior generally. It
might be possible to put checks in (with a potentially non-trivial overhead
cost) to disallow that kind of thing, but again R (and everyone else, I
think?) doesn't do so for regular doubles.

Also, I would expect the year 1e50 and the "year" Inf to be functionally
equivalent in meaning (and largely meaningless) in context.


On Tue, Jun 12, 2018 at 4:23 PM, Greg Minshall <minshall using acm.org> wrote:

> Martin, et al.,
> > I think we should allow 'year' to be "double" instead, and so it
> > could also be +Inf or -Inf and we'd nicely cover
> > the conversions from and to 'numeric' -- which is really used
> > internally for dates and date-times in  POSIXct.
> storing years as a double makes me worry slightly about
> ----
> > year <- 1e50
> > (year+1)-year
> [1] 0
> ----
> which is not how one thinks of years (or integers) as behaving.
> cheers, Greg
> ps -- sorry for the ">" overloading!
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

Gabriel Becker, Ph.D
Bioinformatics and Computational Biology
Genentech Research

	[[alternative HTML version deleted]]

More information about the R-devel mailing list