-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Abraham
Mathew
Sent: Friday, June 10, 2016 6:15 PM
To: r-help at r-project.org
Subject: [R] Merging two data frame with different lengths
So I have two data frames.
The first one is a reccomendation data frame and the second is a melted list
with a pairing of OpportunityId's and ProductId's. There are multiple product
id's per an opportunty id. What I want to do is merge based on ProductId so
that I can add the OpportunityId to the reccomendation data frame.
head(product_neighbours_orig[,1:3],2) ProductId
Reccomendation_1 Reccomendation_2
1 01t30000001ik30AAA 01ta0000005SivAAAS 01ta0000005RQimAAG
2 01t30000001ik3vAAA 01t30000001ik5bAAA 01t30000001ikKPAAY>
head(pd_melt[,1:3],2) OpportunityId ProductId value
4826 0063000000bqUKlAAM 01t30000001ik3vAAA 0
9651 0063000000bqUKlAAM 01t30000001ik41AAA 0
Any suggestions?