From ripley at stats.ox.ac.uk  Fri Apr  2 07:05:49 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri Apr  2 07:06:02 2004
Subject: [Rd] R1,9,0beta: strange summary of Date object
In-Reply-To: <406CACDE.4465.317BEF3@localhost>
Message-ID: <Pine.LNX.4.44.0404020603590.3322-100000@gannet.stats>

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


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