[R-SIG-Finance] xts to timeSeries conversion

R. Michael Weylandt michael.weylandt at gmail.com
Sat Mar 24 14:59:51 CET 2012


Is as.timeSeries not sufficient? (It will dispatch to as.timeSeries.xts)

Michael

On Sat, Mar 24, 2012 at 9:58 AM, Golam Sakline <golam.sakline at gmail.com> wrote:
> Hi Michael,
>
> Thank you for you reply, but in general are you aware of any ways to convert xts date to timeSeries date using intermediate data.frame conversion in between.
>
> Thank you in advance.
>
> Golam
>
> Sent from my iPhone
>
> On 24 Mar 2012, at 13:13, "R. Michael Weylandt" <michael.weylandt at gmail.com> wrote:
>
>> I'm not sure I understand. PerformanceAnalytics is part of the
>> "xts-family" (as opposed to the Rmetrics family) of finance packages.
>> Your problem may be that it requires returns, but consider this
>> (somewhat opaque) one liner.
>>
>> charts.PerformanceSummary(ROC(Cl(to.weekly(Ad(getSymbols("IBM",auto.assign
>> = F))))))
>>
>> which works just fine (using 3 packages explicitly and two major dependencies!)
>>
>> Michael
>>
>> On Sat, Mar 24, 2012 at 9:01 AM, Golam Sakline <golam.sakline at gmail.com> wrote:
>>> How is it possible to get getSymbol object like IBM stock converted to timeSeries object so that it can be plotted in charts.PerformanceSummary() of PerformanceAnalytics in few lines of code. The problem I am having is with the Date column. Please help.
>>>
>>> Thanks
>>>
>>> Riskmaverick
>>>
>>> Sent from my iPhone
>>> _______________________________________________
>>> 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.



More information about the R-SIG-Finance mailing list