Re: [R] how to add tables of different dimensions

2009-09-20 Thread Henrique Dallazuanna
Try this: colSums(rbind(a, b[1:length(a)]), na.rm = TRUE) On Sat, Sep 19, 2009 at 8:30 PM, Henrik Kallberg wrote: > Hi all! > I'm stuck with this "easy" problem. I have two tables  (a and b) which i > would like to add. table a looks like: > a > var1 var2 > 3      4 > and table b looks like: >

[R] how to add tables of different dimensions

2009-09-19 Thread Henrik Kallberg
Hi all! I'm stuck with this "easy" problem. I have two tables (a and b) which i would like to add. table a looks like: a var1 var2 3 4 and table b looks like: b var1 10 I would like this result: c<- a+b c var1 var2 134 Best regards Henrik Källberg ___