[R] julian() and numerical noise
Uwe Ligges
ligges at statistik.tu-dortmund.de
Fri Mar 23 19:47:08 CET 2012
On 23.03.2012 15:45, Andreas Eckner wrote:
> Hi,
>
> does anybody know if the following behavior of julian() is intentional?
>
> > julian(2, 1, 2012) - julian(2 - 1e-15, 1, 2012)
> [1] 1
> > julian(2, 1, 2012) - julian(2, 1 - 1e-15, 2012)
> [1] 0
> > julian(2, 1, 2012) - julian(2, 1, 2012 - 1e-15)
> [1] 0
>
> In other words, julian() is subject to numerical noise in the 'day'
> argument, but not in the 'month' and 'year' argument? Another example:
>
> > julian(2 - 1e-15, 1, 2012) - julian(1 - 1e-15, 1, 2012)
> [1] 30
Which vbersion of R are you talking about?
I get:
> julian(2, 1, 2012) - julian(2 - 1e-15, 1, 2012)
Error in UseMethod("julian") :
no applicable method for 'julian' applied to an object of class
"c('double', 'numeric')"
Uwe Ligges
> Thanks,
> Andreas
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list