Hello
How can I remove the last 100 elements of a zoo series?
I know the name[-element] notation but I can't get it work to substract a full section
Hello
How can I remove the last 100 elements of a zoo series?
I know the name[-element] notation but I can't get it work to substract a full section
Just use the numeric indices, ie
n <- nrow(X)
X <- X[1:(N-100-1),]
where you should need to ensure N
is larger 100 etc
I like using head
for this because it's easier to type. The other methods probably execute faster though... but I'm lazy and my computer is not. ;-)
x <- head(x,-100)
> head(1:102,-100)
[1] 1 2
Hi thanks What I really need is a little bit more complicated. I need to shift the series, removing some elements and adding other from the other side but when I do c(rep(0,10),x[1:(length(x)-11)]) it's not zoo any more.
cheers