[R] xts POSIXct index format

Joshua Ulrich josh.m.ulrich at gmail.com
Sat Mar 5 17:28:13 CET 2011


Hi Chris,

Perhaps something like this?

require(xts)
ds <- options(digits.secs=6) # so we can see sub-seconds
x <- xts(1:10, as.POSIXct("2011-01-21") + c(1,1,1,2:8)/1e3)
x
indexFormat(x) <- "%H:%M:%OS3"
x

Hope that helps,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com



On Fri, Mar 4, 2011 at 5:57 PM, rivercode <aquanyc at gmail.com> wrote:
> Hi,
>
> I cannot figure out how to change the index format when displaying POSIXct
> objects.
>
> Would like the xts index to display as %H:%M:%OS3 when doing viewing the xts
> object.
>
> Think I am missing the obvious.
>
> Cheers,
> Chris
>
> --
> View this message in context: http://r.789695.n4.nabble.com/xts-POSIXct-index-format-tp3336136p3336136.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



More information about the R-help mailing list