Re: [R] How to mean, min lists and numbers

2010-07-13 Thread Jim Lemon
On 07/13/2010 01:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck,

[R] How to mean, min lists and numbers

2010-07-12 Thread guox
I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck, Reduce('+',list(-1,2*c(1,1,0),2,c(-1,10,-1))) returns what we

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread Duncan Murdoch
On 12/07/2010 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck,

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. You will advance in your understanding faster if you adopt the correct terminology: -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but ... which is

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 11:19 AM, Duncan Murdoch wrote: On 12/07/2010 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list.