Re: [R] Strange julian and/or strptime

From: jim holtman <jholtman_at_gmail.com>
Date: Fri, 23 May 2008 07:42:12 -0400

It is not a bug.

Y2K strikes again, a couple of years late.

On Fri, May 23, 2008 at 7:17 AM, Kåre Edvardsen <ked_at_nilu.no> wrote:

> I'm on an Ubuntu Linux PC, and get the same wrong result as you.
> I could not work out what the description of '%y' really ment, so I did
> not realize this was operating system specific in this sense. Anyway,
> I'll find a way to work around this bug.
>
> Have a nice weekend,
> Kare
>
>
> On Fri, 2008-05-23 at 10:41 +0100, Prof Brian Ripley wrote:
>
> > On my Linux box:
> >
> > > strptime("010169", format = "%d%m%y")
> > [1] "1969-01-01"
> > > strptime("311268", format = "%d%m%y")
> > [1] "2068-12-31"
> >
> > >From the help page:
> >
> > '%y' Year without century (00-99). If you use this on input, which
> > century you get is system-specific. So don't! Often values
> > up to 69 (or 68) are prefixed by 20 and 70 (or 69) to 99 by
> > 19.
> >
> > If all else fails, read the documentation (but the posting guide asks you
> > to do that before posting). Elsewhere on that help page it refers you to
> > your OS documentation -- the posting guide asked for your OS 'at a
> > minimum', but as you didn't follow it so we have no idea which you used.
> >
> > On Fri, 23 May 2008, Kåre Edvardsen wrote:
> >
> > > Hi r-helpers...
> > >
> > > Why do I get this strange huge jump of 36524 days when changing
> "origin"
> > > from 1969-01-01 to 1968-12-31. It should still be close to zero! This
> > > really messes up my calculations of follow-up times in my analyses.
> > >
> > >> julian(strptime("010169", format = "%d%m%y"),origin =
> > > as.Date("1969-01-01"))
> > >> Time difference of -0.04166667 days
> > >
> > >> julian(strptime("311268", format = "%d%m%y"),origin =
> > > as.Date("1968-12-31"))
> > >> Time difference of 36524.96 days
> > >
> > >
> > > Cheers,
> > > Kare
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > ______________________________________________
> > > 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<http://www.r-project.org/posting-guide.html>
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> >
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]


______________________________________________ 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.

Received on Fri 23 May 2008 - 11:44:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 23 May 2008 - 12:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive