td =
timeSeq(from="9/15/2003", to = "4/15/2003", by=-"bizdays")
td =
timeSeq(from="9/15/2003", to="4/15/2003", by = "bizdays")
or
td1 = timeSeq(from="4/15/2003",
to"9/15/2003", by="bizdays")
td = -sort(-td1) [ sort does not
work with timeDate sequences]
Thanks to Jeffrey Wang, Chuck Taylor, Tony Plate,
James Holman, and Nick Ellis for helpful replies. There are 3 ways to
easily invert or reverse a timeDate sequence:
The most direct way is simply to :
1) td = td1[ length(td1): 1 ], where td is
the reversed sequence and td1 the forward sequence.
2) Nick Ellis pointed out another direct
way:
td=timeSeq(from="9/15/2003", to
"4/15/2003, by = "bizdays", k.by = -1)
[ it always helps to read the language reference
thoroughly...]
3) Finally you can use the rev function:
td = rev(td1)
Paul H. Lasky
B & P Consultants
Rancho Santa Fe, CA