Hi,
 
I observed that if I use window() function available with the 'zoo' package to 
extract a portion of my times series and if that time series data is stored in 
some 'zoo' object with only 1 column, then the resulting zoo object is becoming 
vector.
 
Here is my observation:
 
> library(zoo)
> Dat <- matrix(1:3, nc = 1)
> Dat
     [,1]
[1,]    1
[2,]    2
[3,]    3
> Dat_zoo <- zooreg(Dat, start = as.Date("2001-01-01"), frequency = 1)
> Dat_zoo
            
2001-01-01 1
2001-01-02 2
2001-01-03 3
> window(Dat_zoo, start = as.Date("2001-01-02"))   ### why it is becoming 
> vector? I want to retain it as matrix only
2001-01-02 2001-01-03 
         2          3 
 
Here you can see that, originally my 'Dat_zoo ' object was basically a matrix. 
However once I use window() function, it became vector.
 
Is there any possibility to retain the shape of the original object, 
particularly if that object is matrix with 1 column?
 
Thank you very much for your help.
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to