Re: [R] xts POSIXct index format

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Sun, 06 Mar 2011 00:00:05 -0500

On Mar 5, 2011, at 11:28 AM, Joshua Ulrich wrote:

> 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
>

Joshua;

Does your reading of help(indexFormat) lead you to that suggestion? When I read it I thought that indexFormat would only accept onoe of " Date, POSIXct, chron,yearmon, yearqtr or timeDate." Those were the formats mentioned in the immediately preceding paragraph. I went to the help page hoping I would be told I could use format strings but left it thinking that I could only specify format classes.

-- 
David



> 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.
>>
>
> ______________________________________________
> 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.
David Winsemius, MD Heritage Laboratories West Hartford, CT ______________________________________________ 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.
Received on Sun 06 Mar 2011 - 05:05:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Mar 2011 - 01:40:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive