Re: [R] Sum vectors and numbers

2010-07-07 Thread Gabor Grothendieck
On Wed, Jul 7, 2010 at 11:35 AM, wrote: > We want to sum many vectors and numbers together as a vector if there is > at least one vector in the arguments. > For example, 1 + c(2,3) = c(3,4). > Since we are not sure arguments to sum, we are using sum function: > sum(v1,v2,...,n1,n2,..). > The prob

Re: [R] Sum vectors and numbers

2010-07-07 Thread Erik Iverson
g...@ucalgary.ca wrote: We want to sum many vectors and numbers together as a vector if there is at least one vector in the arguments. For example, 1 + c(2,3) = c(3,4). Since we are not sure arguments to sum, we are using sum function: sum(v1,v2,...,n1,n2,..). The problem is that sum returns th

[R] Sum vectors and numbers

2010-07-07 Thread guox
We want to sum many vectors and numbers together as a vector if there is at least one vector in the arguments. For example, 1 + c(2,3) = c(3,4). Since we are not sure arguments to sum, we are using sum function: sum(v1,v2,...,n1,n2,..). The problem is that sum returns the sum of all the values pres