Skip to content
Prev 8424 / 15274 Next

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,