[R] as.POSIXct problem?

Dirk Eddelbuettel edd at debian.org
Fri Jan 3 04:40:03 CET 2003


On Thu, Jan 02, 2003 at 08:56:28PM -0500, Frank E Harrell Jr wrote:
> Under
> 
> platform i686-pc-linux-gnu
> arch     i686             
> os       linux-gnu        
> system   i686, linux-gnu  
> status                    
> major    1                
> minor    6.1              
> year     2002             
> month    11               
> day      01               
> language R                
> 
> > x <- strptime(c('10/10/1969','12/31/2002'),format='%m/%d/%Y')
> > x
> [1] "1969-10-10" "2002-12-31"
> > as.POSIXct(x)
> [1] NA               "2002-12-31 EST"
> 
> Why the NA?  If this is not the preferred way to convert a character string to POSIXct what is?  On a more minor note why the EST if no time is printed?

Quick guess:  Unix time does start by convention on 1/1/1970 at GMT. Going
before it is not within the specs, or safe. 

Dirk

-- 
Prediction is very difficult, especially about the future. 
				             -- Niels Bohr




More information about the R-help mailing list