[Rd] problem with strptime example (PR#811)
ripley@stats.ox.ac.uk
ripley@stats.ox.ac.uk
Mon, 1 Oct 2001 16:12:24 +0200 (MET DST)
On Mon, 1 Oct 2001, Arto Luoma wrote:
> Hello,
>
> strptime is still not working correctly in my computer
> (Windows 98 and R Version 1.3.1)
This is working as documented, i.e. correctly.
> From
>
> x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> strptime(x, "%d%b%Y")
>
> I obtain
>
> [1] "NA" "NA" "NA" "NA"
>
> while
> x <- c("01011960", "02011960", "3131960", "3071960")
> strptime(x, "%d%m%Y")
>
> gives
> [1] "1960-01-01" "1960-01-02" "1960-03-31" "1960-07-30"
>
> So it seems that the problem is with %b.
Do read all the example, which contains an explanation and workaround
(which does not work on all systems and hence is in the comments).
In your locale `jan' is not the abbreviation for January, I believe.
--
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._