[R] Unable to understand strptime() behaviour

BXC (Bendix Carstensen) bxc at steno.dk
Wed Dec 1 10:52:20 CET 2004


Try to say:

class(x)
unclass(x)

and it will dawn on you what goes on.

----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc
----------------------



> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Tim Churches
> Sent: Tuesday, November 30, 2004 11:37 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Unable to understand strptime() behaviour
> 
> 
> R V2.0.1 on Windows XP.
> 
> I have read the help pages on strptime() over and over, but 
> can't understand why strptime() is producing the following results.
> 
>    > v <- format("2002-11-31", format="%Y-%m-%d")
>    > v
> [1] "2002-11-31"
>    > factor(v, levels=v)
> [1] 2002-11-31
> Levels: 2002-11-31
>    > x <- strptime("2002-11-31", format="%Y-%m-%d")
>    > x
> [1] "2002-12-01"
>    > factor(x, levels=x)
> [1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
> Levels: 2002-12-01 NA NA NA NA NA NA NA NA
> 
> Tim C
> 
> ______________________________________________
> 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