[R-SIG-Finance] xts to timeSeries conversion

Brian G. Peterson brian at braverock.com
Sat Mar 24 14:13:19 CET 2012


On Sat, 2012-03-24 at 13:01 +0000, Golam Sakline 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.

PerformanceAnalytics uses xts internally for everything.  It also
accepts timeSeries-classed objects, but they will be converted to xts
internally.

You didn't follow the posting guide and provide a reproducible example,
so I can't tell what your problem really is, but the following works for
me:

require(quantmod)
require(PerformanceAnalytics)
getSymbols('IBM')
IBM$Returns<-Return.calculate(Cl(IBM))
charts.PerformanceSummary(IBM$Returns)



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



More information about the R-SIG-Finance mailing list