[R-SIG-Finance] print an xts object in reverse order

Jeffrey Ryan jeffrey.ryan at lemnica.com
Wed Nov 16 01:07:52 CET 2011


You can't.

xts enforces time order - if it didn't it would be nearly useless.

If you really need to reverse the order, you should think twice about
it. If upon further consideration you still need it reversed, you can
coerce to something else to accommodate.

rev(coredata(x))
rev(as.matrix(x)

or

rev(as.zoo(x))

The latter is strange to me, as it reverses the underlying series, but
not the dates.  Sort of alluding to the 'do you really want to do
this...'

Jeff

On Tue, Nov 15, 2011 at 5:14 PM, Chris de Bleu <blue2bleu at yahoo.fr> wrote:
> Hi,
>
> I would like to know how can I print an xts object in reverse order?
>
>
> rev(xtsObject) always gives the same order as xtsObject.
>
> Thanks
>
>        [[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.
>



-- 
Jeffrey Ryan
jeffrey.ryan at lemnica.com

www.lemnica.com
www.esotericR.com



More information about the R-SIG-Finance mailing list