[R] help with time data - R weird behaviour across machines

Tiago Marques tiago at mcs.st-and.ac.uk
Wed Mar 7 01:46:24 CET 2012


Hello list,

I was hoping I could get some help on something which is really giving 
me a headache. I am using R version 2.14.1 (2011-12-22)
(Platform: x86_64-pc-mingw32/x64 (64-bit))

An object which is supposed to have times has a few elements listed as 
not times but NA's

 > ls()
[1] "todelete"
 > class(todelete)
[1] "POSIXlt" "POSIXt"
 > todelete
[1] "2011-03-27 00:59:57" "2011-03-27 00:59:58" "2011-03-27 01:00:01" 
"2011-03-27 01:00:02"
 > is.na(todelete)
[1] FALSE FALSE  TRUE  TRUE
 > as.numeric(todelete)
[1] 1301187597 1301187598         NA         NA

but on another machine, from a colleague, over the same workspace, 
returns this, as expected:

 > ls()
[1] "todelete"
 > class(todelete)
[1] "POSIXlt" "POSIXt"
 > todelete
[1] "2011-03-27 00:59:57" "2011-03-27 00:59:58" "2011-03-27 01:00:01"
[4] "2011-03-27 01:00:02"
 > is.na(todelete)
[1] FALSE FALSE FALSE FALSE
 > as.numeric(todelete)
[1] 1301180397 1301180398 1301180401 1301180402

any suggestions about what might be going on here would be greatly 
appreciated.

all the best

Tiago

-- 
____________________________________________________________________________________________________ 

Tiago André Marques
Research Unit for Wildlife Population Assessment
Centre for Research into Ecological and Environmental Modelling
University of St Andrews
The Observatory
Buchanan Gardens
St Andrews
Fife KY16 9LZ
Scotland

Tel: 00441334461842 Fax: 00441334461800 (Scotland office)
Tel: 00351210198736 (Portugal home)

http://www-maths.mcs.st-andrews.ac.uk/homepages/tam2.html
http://www.creem.st-and.ac.uk/tiago/

The University of St Andrews is a charity registered in Scotland : No 
SC013532



More information about the R-help mailing list