[R] as.numeric() and POSIXct format

Agustin Lobo Agustin.Lobo at ija.csic.es
Wed Aug 24 18:22:18 CEST 2011


Hi!

I'm confused by this:
 > as.numeric(as.POSIXct(518400,origin="2001-01-01"))
[1] 978822000

I guess the problem is that as.numeric() assumes a different origin, but cannot find
any default origin.

How can I get back the seconds from the POSIXct format? In other words, which 
the inverse function of as.POSIXct()?
I've tried as.numeric and unclass() using a origin= argument, but this does not 
work.

Thanks

Agus

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es



More information about the R-help mailing list