Re: [R] Comparing and adding two data series

2009-08-27 Thread Maithili Shiva
Dear Peter Konings   Thanks a lot for your kind advice. It worked wonderfully.   Thanks again   Regards   Maithili --- On Thu, 27/8/09, Peter Konings wrote: From: Peter Konings Subject: Re: [R] Comparing and adding two data series To: "Maithili Shiva" Date: Thursday, 27 August, 2

Re: [R] Comparing and adding two data series

2009-08-27 Thread Gabor Grothendieck
again. > > With warmest regards > > Maithili > > --- On Thu, 27/8/09, Gerrit Eichner > wrote: > > > From: Gerrit Eichner > Subject: Re: [R] Comparing and adding two data series > To: "Maithili Shiva" > Date: Thursday, 27 August, 2009, 10:57 AM &

Re: [R] Comparing and adding two data series

2009-08-27 Thread Maithili Shiva
Subject: Re: [R] Comparing and adding two data series To: "Maithili Shiva" Date: Thursday, 27 August, 2009, 10:57 AM Try tapply( B, A, sum) On Thu, 27 Aug 2009, Maithili Shiva wrote: > Dear R helpers >   > I have two series A and B as given below - >   > A <- c(2

[R] Comparing and adding two data series

2009-08-27 Thread Maithili Shiva
Dear R helpers   I have two series A and B as given below -   A <- c(2, 2, 1, 3, 7, 3, 3, 1, 14, 7, 31) B <- c(0.0728,0.9538,4.0140,0.0020,2.5593,0.1620,2.513,0.3798, .0033,0.2282, 0.1614)   I need to calculate the total in dataset B corresponding to the numbers in dataset A i.e. for no 1 in A,