[Rd] R1,9,0beta: strange summary of Date object

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Apr 2 07:05:49 CEST 2004


On Thu, 1 Apr 2004 kjetil at entelnet.bo wrote:

> Hola!
> 
> Any explanation of the following:
> 
> > summary(as.Date(rep(NA,20)))
>         Min.      1st Qu.       Median         Mean      3rd Qu.      
>    Max. 
>           NA           NA           NA           NA           NA      
>      NA 
>         NA's 
> "1970-01-21" 
> 
> Where does this 1970 date come from?

By coercion.  Same thing happens with POSIXct.  It could be improved, but 
seems to have caused no real problems in the POSIXct case.

-- 
Brian D. Ripley,                  ripley at 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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list