Skip to content

xts timeBasedSeq

4 messages · Rods, Joshua Ulrich, Tom Clifford

#
Hi,

I'm trying to make a time sequence using the length.out argument but it
just outputs a list without the sequence. I'm just running the example
shown in the xts package:

timeBasedSeq('20080101 0830',length=100)

Is there something wrong with my installation?

Thanks in advance,
Rod
#
Hi Rod,
On Tue, Dec 22, 2015 at 6:02 PM, Rods <uchiharj at gmail.com> wrote:
Hard to know, since you haven't told us anything about your installation. ;)

That said, most of the code in that function has not been touched
since mid-2008. There was a commit in early 2009 that attempted to fix
a bug, and the commit message says the fix is incomplete:
https://github.com/joshuaulrich/xts/commit/743c686c8e2819d0991821d8965ccbe4b7782f3

So that's likely what you're seeing.  I'll investigate and open an
issue once I can put a bit more context into the report.

  
    
#
Rod, if you're looking to get a sequence of incrementing minutes, you can use

timeBasedSeq("20080101 0830/M", length.out = 100)

this will give you:

?[1] "2008-01-01 08:30:00 EST" "2008-01-01 08:31:00 EST" "2008-01-01 08:32:00 EST" "2008-01-01 08:33:00 EST"
?[5] "2008-01-01 08:34:00 EST" "2008-01-01 08:35:00 EST" "2008-01-01 08:36:00 EST" "2008-01-01 08:37:00 EST"
?[9] "2008-01-01 08:38:00 EST" "2008-01-01 08:39:00 EST" "2008-01-01 08:40:00 EST" "2008-01-01 08:41:00 EST"

.....


[93] "2008-01-01 10:02:00 EST" "2008-01-01 10:03:00 EST" "2008-01-01 10:04:00 EST" "2008-01-01 10:05:00 EST"
[97] "2008-01-01 10:06:00 EST" "2008-01-01 10:07:00 EST" "2008-01-01 10:08:00 EST" "2008-01-01 10:09:00 EST"?Tom Clifford Northwood Univ MBA '13 Lansing, Michigan 48912 tjclifford at yahoo.com
 

      From: Rods <uchiharj at gmail.com>
 To: r-sig-finance at r-project.org 
 Sent: Tuesday, December 22, 2015 7:02 PM
 Subject: [R-SIG-Finance] xts timeBasedSeq
   
Hi,

I'm trying to make a time sequence using the length.out argument but it
just outputs a list without the sequence. I'm just running the example
shown in the xts package:

timeBasedSeq('20080101 0830',length=100)

Is there something wrong with my installation?

Thanks in advance,
Rod

??? [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
#
Thank you that works!

On Wed, Dec 23, 2015 at 12:22 PM, Tom Clifford via R-SIG-Finance <
r-sig-finance at r-project.org> wrote: