[R] Function as.Date leading to error implying that strptime requires 3 arguments

Gabor Grothendieck ggrothendieck at gmail.com
Sat May 20 04:56:34 CEST 2006


I can't reproduce this on my XP system:

> x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> z <- as.Date(x, "%d%b%Y")
> z
[1] "1960-01-01" "1960-01-02" "1960-03-31" "1960-07-30"
> R.version.string # XP
[1] "R version 2.2.1, 2005-12-20"

I also tried it on 2.3.0 patched and could not reproduce it there
either.

On 5/19/06, Rob Balshaw <Rob.Balshaw at syreon.com> wrote:
>
> I'm using R V 2.2.1.  When I try an example from the as.Date help page,
> I get an error.
>
> > x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> > z <- as.Date(x, "%d%b%Y")
> Error in strptime(x, format) : 2 arguments passed to 'strptime' which
> requires 3
> >
>
> Any suggestions would be appreciated.
>
> Thanks,
>
> Rob
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list