From becker@g@be @ending from gene@com  Wed Jun 13 18:20:16 2018
From: becker@g@be @ending from gene@com (Gabe Becker)
Date: Wed, 13 Jun 2018 09:20:16 -0700
Subject: [Rd] 
 Date class shows Inf as NA; this confuses the use of is.na()
In-Reply-To: <21039.1528845816@minshall-apollo.minshall.org>
References: <23327.62641.524004.675246@stat.math.ethz.ch>
 <21039.1528845816@minshall-apollo.minshall.org>
Message-ID: <CAMFmJsm9ut8dHQLY89vJZ7-ocofM3WEPxRdTYhnB-fL3+by_wQ@mail.gmail.com>

Greg,

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.

Best,
~G

On Tue, Jun 12, 2018 at 4:23 PM, Greg Minshall <minshall at 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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>


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

	[[alternative HTML version deleted]]



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