[R-SIG-Finance] [R-sig-finance] Array to xts/zoo

Brian G. Peterson brian at braverock.com
Thu Aug 6 13:44:12 CEST 2009


ehxpieterse wrote:
> Hi,
>
> I have an array which holds the cumulative profit of a trading strategy over
> time. I use raw data of class xts/zoo by using quantmod's
> getSymbols("^DJI").
>
> My question: How do I transform my array to a zoo/xts class, by also using
> the date formatting in the raw data? The array shows the corresponding
> profit/loss for each day of data downloaded. Both my array and the raw data
> from getSymbols have the same number of elements.
>
> Thanks in advance.
> Eduard
>   
may I suggest chapter 9 of  
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf

failing that, try cbind()

In the future, I suggest that when dealing with timeseries, keep *all* 
of your data conveniently indexed by time.

Cheers,

  - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list