Sorry if this is terribly formatted, I'm still getting used to this site and learning how to do things in R. Sorry if this is an obvious question also, but I tried a lot of different things and looked up similar questions and answers and still couldn't figure this out :(
I want to merge the data.frames (frame1 and frame2) by columns V1 and VB, keeping the rows that match, but excluding the rows that don't the get something like frame3.
frame1
V1 V2
A 1a
B 2a
C 3a
D 4a
frame2
VA VB VC
1 A 15
2 B 14
3 C 13
4 AA 12
5 BB 11
6 D 10
frame3
V1VB V2 VA VC
A 1a 1 15
B 2a 2 14
C 3a 3 13
D 4a 6 10
I tried:
test <- merge(frame1, frame2, by.x='V1',by.y='VB',all=FALSE)
test
But I'm not getting my intended result.
Thank-you for all your help!