Skip to content
Back to formatted view

Raw Message

Message-ID: <CAMPD5GVfxg6B5UJzoocP9ASQZ2YvSzniFtbk=_JbSHQGRWw_6w@mail.gmail.com>
Date: 2011-09-02T11:00:28Z
From: Dean Marks
Subject: PerformanceAnalytics apply.rolling with NAs

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