Re: [R] Combining tables

2008-09-14 Thread Andre Nathan
Thanks Jim, it worked great! On Sun, 2008-09-14 at 21:27 -0400, jim holtman wrote: > try this: > > > c(tx,ty) > 1 2 3 3 4 > 3 2 1 4 1 > > z <- c(tx,ty) > > tapply(z, names(z), sum) > 1 2 3 4 > 3 2 5 1 > > __ R-help@r-project.org mailing list https://s

[R] Combining tables

2008-09-14 Thread Andre Nathan
Hello Say I have the following data, and it's distribution given by table(): > x <- c(1, 1, 1, 2, 2, 3) > tx <- table(x) > tx x 1 2 3 3 2 1 Now say I have new data, > y <- c(3, 3, 3, 3, 4) > ty <- table(y) > ty y 3 4 4 1 Is there a way to "combine" tx and ty in such a w