Reputation: 4474
Let's say we have the following multivariate time series
A=zoo(data.frame(x=100:101,y=200:201,z=300:301),1:2)
Everything is fine with colnames(A)
here. The function gives
[1] "x" "y" "z"
Now select a specific date of the time series
B=A[1,]
colnames(B)
gives the same result as above. So, everything is still fine.
Let's further reduce the time series by
C=B[,abs(B)>=300]
In this case, colnames(C)
returns NULL
. That is, the column name information z
is lost.
Any pointers to how to fix this? Thank you!
Upvotes: 1
Views: 194