Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0404020603590.3322-100000@gannet.stats>
Date: 2004-04-02T07:06:02Z
From: Brian Ripley
Subject: R1,9,0beta: strange summary of Date object
In-Reply-To: <406CACDE.4465.317BEF3@localhost>

On Thu, 1 Apr 2004 kjetil@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@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