[R-SIG-Finance] PerformanceAnalytics apply.rolling with NAs

Dean Marks dean at aeonim.co.za
Fri Sep 2 13:00:28 CEST 2011


Hi,

I'm having the following issue:

require( PerformanceAnalytics )
data( managers )

#This works fine:
x <- managers[ , "SP500 TR"]
apply.rolling( x , width = 6 )

#This produces an error (presumably due to indexes being empty)
x[] <- NA
apply.rolling( x , width = 6 )
###  Error in xts(, order.by = time(R)) :
###  order.by requires an appropriate time-based object

Is this the expected behavior? How would I avoid the error without
having to check for the special case(s)?

Thanks,

-- 
Dean Marks
Investment Analyst
Aeon Investment Management
Tel: +27 (0)21 670 5295
Fax: +27 (0)86 508 0685
Mobile: +27 (0)72 417 4720
Email: dean at aeonim.co.za
www.aeonim.co.za
4th Floor, MontClare Place
Cnr Campground & Main Roads
Claremont, 7708
PO Box 24020, Claremont, 7735
An authorised financial services provider FSP No. 27126



More information about the R-SIG-Finance mailing list