On Wed, May 19, 2004 at 03:24:38PM -0400, [EMAIL PROTECTED] wrote:
> I am trying to use POSIX datetime objects rather than chron datetime
> objects but am having difficulty with POSIX in a time series.  My
> question:  Once a POSIXct vector is bound to a time series, is there a
> function to convert back to POSIXct?  The following code demonstrates
> what I am trying to do.
> 
> > ts(as.POSIXct(strptime(tmp,"%m/%d/%Y %H:%M:%S")),freq=1440)
> Time Series:
> Start = c(1, 1)
> End = c(1, 10)
> Frequency = 1440
>  [1] 1074022572 1074022632 1074022693 1074022753 1074022813 1074022874
> 1074022934 1074022994 1074023055 1074023115
> attr(,"tzone")
> [1]
...

for the reverse process, something like....

## UNTESTED!
yourts <- ts(as.POSIXct(strptime(tmp,"%m/%d/%Y %H:%M:%S")),freq=1440)
ISOdate(1970,1,1,0,0,0,UTC) + time(yourts)

Cheers

Jason
-- 
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to