[Rd] problem with strptime example (PR#811)

ligges@statistik.uni-dortmund.de ligges@statistik.uni-dortmund.de
Fri, 12 Jan 2001 11:15:37 +0100 (MET)


ripley@stats.ox.ac.uk wrote:
> 
> On Thu, 11 Jan 2001 stephen@anc.ed.ac.uk wrote:
> 
> > Hi,
> >
> > The help file for strptime has the following code which doesn't work
> > for me:
> >
> >      ## read in date info in format `ddmmmyyyy'
> >      x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> >      z <- strptime(x, "%d%b%Y")
> > > z
> > [1] "NA" "NA" "NA" "NA"
> >
> > Do these work for other people?
> 
> Yes, on several platforms.  It will be a problem with your OS's strptime
> code.  It must be, I think, as the alternative we supply works.
> 
> > whereas it works fine if I use a separator (/) in the date@
> >
> > > strptime("9/Feb/1960", "%d/%b/%Y")
> > [1] "1960-02-09"
> >
> > > strptime("9Feb1960", "%d%b%Y")
> > [1] "NA"
> 
> We really do not put out new features without testing them!


Also very strange on WinNT4.0 (R-1.2.0): 


  x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
  z <- strptime(x, "%d%b%Y")
  z
[1] "1960-01-01 01:00:00" "1960-01-02 01:00:00" "NA"                 
"1960-07-30 01:00:00"


Uwe Ligges

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._