Re: [R] How to Merge based on Rows

2010-01-08 Thread Gabor Grothendieck
Try this. (The second line removes the suffixes in the column names.) > out <- merge(x1, x2, by = 0, all = TRUE)[-1] > names(out) <- sub("\\..*", "", names(out)) > out Apples Oranges Pears Apples Oranges Pears 1 5 6 7 5 3 9 2 5 3 4 3 2

Re: [R] How to Merge based on Rows

2010-01-08 Thread jim holtman
Is this what you want: > x1$names <- rownames(x1) > x1 Apples Oranges Pears names A 5 6 7 A B 5 3 4 B C 8 910 C D 11 1314 D E 15 3 8 E F 1 4 5 F > x2$names <- rownames(x2) > x2 Apples

[R] How to Merge based on Rows

2010-01-08 Thread MRKidd
Let's say that I have a bunch of matrices. They look like this (pardon using fruit for examples, my actual data tables are far too enormous): Matrix1 Apples Oranges Pears A 5 6 7 B 5 3 4 C 8 9 10 D 11