Re: [R] zoo arithmetics

2011-10-24 Thread Achim Zeileis
On Mon, 24 Oct 2011, Hugo Mildenberger wrote: Dear list members, what is the reason that one obviously can't do arithmetic operations on zoo members with different index positions? It's a _feature_ that zoo first matches the index positions, uses only their intersection, and then performs ar

Re: [R] zoo arithmetics

2011-10-24 Thread David Winsemius
On Oct 23, 2011, at 9:35 PM, Hugo Mildenberger wrote: Dear list members, what is the reason that one obviously can't do arithmetic operations on zoo members with different index positions? zoo-objects are designed to merged by their indices before applying arithmetic operations. You a

[R] zoo arithmetics

2011-10-23 Thread Hugo Mildenberger
Dear list members, what is the reason that one obviously can't do arithmetic operations on zoo members with different index positions? > require(zoo) > z <- zoo(c(1,1,1),order.by=c(1,2,3)) > z 1 2 3 1 1 1 > z[1] + z[1] 1 2 > z[1:2] + z[1:2] 1 2 2 2 > z[1] +