Author Login
Post Reply
> From: Hasan Diwan <hasan.diwan@(protected)>
> To: R Project Help <r-help@(protected)>
> Date: 01/27/2012 10:47 AM
> Subject: [R] PosixCT subsecond accuracy
> Sent by: r-help-bounces@(protected)
>
> The first column is epoch time. I read that POSIXct has support for
> this, sort of[1]. So, I tried:
> > sensor[,1] <- as.POSIXct(sensor[,1]/1000, origin='1970-01-01
12:00:00')
> > head(sensor)
> logged_on accx accy accz compassx compassy
> compassz gyrox gyroy gyroz
> 1 2012-01-15 05:17:08 -0.4602 0.8346 0.0936 0.145508 -0.350586
> 0.259766 59.617390 28.521740 59.617390
> 2 2012-01-15 05:17:08 -0.4212 1.0452 0.1326 0.219727 -0.321289
> 0.241211 88.695656 27.478260 88.695656
> 3 2012-01-15 05:17:08 -0.2496 1.3416 0.2886 0.214844 -0.326172
> 0.141602 29.565218 -14.747826 29.565218
> 4 2012-01-15 05:17:08 -0.3276 1.0374 0.0546 0.261719 -0.314453
> 0.243164 8.765218 16.556522 8.765218
> 5 2012-01-15 05:17:08 -0.3588 1.0686 0.2418 0.229492 -0.307617
> 0.212891 -33.808697 35.756523 -33.808697
> 6 2012-01-15 05:17:08 -0.3120 1.0686 0.2652 0.261719 -0.289062
> 0.246094 -40.347828 24.626087 -40.347828
>
> But now the fractional seconds are missing... Help? -- H
?options, look for digits.secs, and probably set it to 3, but careful of
the character representation of those stamps. See David's helpful work
around of 24 January at
http://r.789695.n4.nabble.com/POSIXct-value-display-incorrect-for-some-values-td4311446.html
--
Curt Seeliger, Data Ranger
Raytheon Information Services - Contractor to ORD
seeliger.curt@(protected)
541/754-4638
[[alternative HTML version deleted]]
______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.