Skip to content

Need help on window() function of the 'zoo' package

2 messages · Ron Michael, Rui Barradas

#
Hello,

Actually, Dat_zoo is not a matrix, it is an object of classes "zooreg" 
and "zoo", with a dim attribute:

class(Dat_zoo)
dim(Dat_zoo)

And the output of window() is of the same classes but without a dim 
attribute:

wnd <- window(Dat_zoo, start = as.Date("2001-01-02"))
class(wnd)
dim(wnd)  # NULL


You can set the dim attribute manually like this:

dim(wnd) <- c(length(wnd), 1)


Hope this helps,

Rui Barradas

Em 08-06-2013 22:02, Ron Michael escreveu: