Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-28 Thread Maithili Shiva
Dear Sir,   Thanks a lot for your solution and guidance. It worked wonderfully.   Regards   Maithili --- On Thu, 27/8/09, Gabor Grothendieck ggrothendi...@gmail.com wrote: From: Gabor Grothendieck ggrothendi...@gmail.com Subject: Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

[R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-27 Thread Maithili Shiva
Dear Sirs,   At the outset I sincerely apologize for reproducing my query to you. I also thank all of you for the solution you had provided. It has worked on the actual data I am working with.   However, there is this peculiar problem which I had realized only after I had obtained my

Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-27 Thread Henrique Dallazuanna
Try this: tapply(B, factor(A, levels = seq(max(A))), sum) On Thu, Aug 27, 2009 at 9:26 AM, Maithili Shiva maithili_sh...@yahoo.comwrote: Dear Sirs, At the outset I sincerely apologize for reproducing my query to you. I also thank all of you for the solution you had provided. It has

Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-27 Thread David Winsemius
On Aug 27, 2009, at 8:31 AM, Henrique Dallazuanna wrote: Try this: tapply(B, factor(A, levels = seq(max(A))), sum) Nice! It might have a disadvantage in that it produces NA's instead of the requested 0's, but that would be easily remedied with an: is.na(obj) - 0 It was much neater than

Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-27 Thread Maithili Shiva
  With warm regards   Maithili --- On Thu, 27/8/09, David Winsemius dwinsem...@comcast.net wrote: From: David Winsemius dwinsem...@comcast.net Subject: Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS To: Henrique Dallazuanna www...@gmail.com Cc: Maithili Shiva maithili_sh...@yahoo.com, r

Re: [R] Fw: PROBLEM - - COMPARING AND COMBINING two DATASETS

2009-08-27 Thread Gabor Grothendieck
Try this: xtabs(B ~ factor(A, seq(max(A On Thu, Aug 27, 2009 at 8:26 AM, Maithili Shivamaithili_sh...@yahoo.com wrote: Dear Sirs, At the outset I sincerely apologize for reproducing my query to you. I also thank all of you for the solution you had provided. It has worked on the