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

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Thu, 11 Jan 2001 22:54:38 +0100 (MET)


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!


>
> Stephen
>
> p.s. I failed to send this using bug.report(); on DEC OSF/1, "mailx"
> does not recognise the -c switch for setting the carbon copy (CC)
> field, causing an error.  One solution might be to remove the -c
> argument from the cmdarg in bug.rerport(), or put a
> "~c joe@bloggs.com" directive at the end of the file to set the CC field.
>
> --please do not edit the information below--
>
> Version:
>  platform = alphaev56-dec-osf4.0f
>  arch = alphaev56
>  os = osf4.0f
>  system = alphaev56, osf4.0f
>  status =
>  major = 1
>  minor = 2.0
>  year = 2000
>  month = 12
>  day = 15
>  language = R
>
> Search Path:
>  .GlobalEnv, package:ctest, Autoloads, package:base
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


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