Skip to content
Back to formatted view

Raw Message

Message-ID: <4A7AC20C.1070809@braverock.com>
Date: 2009-08-06T11:44:12Z
From: Brian G. Peterson
Subject: Array to xts/zoo
In-Reply-To: <24841032.post@talk.nabble.com>

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