Re: [R] Merging two data.frames

2014-12-08 Thread William Dunlap
Have you looked at the merge() function? Here is an example. I don't know if it resembles your problem. > M1 <- data.frame(V1=letters[1:3], V2=LETTERS[26:24], N1=101:103) > M2 <- data.frame(V1=letters[c(3,1,2,3,2)], V2=LETTERS[c(23,26,22,24,24)], N2=c(1003,1001,1002,1003,1002)) > merge(M

Re: [R] Merging two data.frames

2014-12-08 Thread Jeff Newmiller
Below... On Mon, 8 Dec 2014, David Lambert wrote: I have 2 data frames, M1[n,20] and M2[m,30]. What does this mean? It might be intended to convey matrix dimensions, but these are not matrices and that is not R syntax. If V1 and V2 are the same in both M1 and M2, then append V3-V30 from M

[R] Merging two data.frames

2014-12-08 Thread David Lambert
I have 2 data frames, M1[n,20] and M2[m,30]. If V1 and V2 are the same in both M1 and M2, then append V3-V30 from M2 onto M1. Otherwise, continue searching for a match. M1 is complete for all V1 and V2. M2 is missing observations for V1 or V2, or both. I can't figure this one out, except