I have a data frame df1 with a list of products like this:
| SKU | Product | Model | Size |
|-----|---------|-------|--------|
| 1 | X | A | Small |
| 2 | X | B | Large |
| 3 | X | B | Medium |
...
And a data frame df2 with the prices for the each of the models and sizes as follows:
| Model | Small | Medium | Large |
|-------|-------|--------|-------|
| A | 10 | 12 | 15 |
| B | 8 | 9 | 10 |
| C | 7 | 8 | 12 |
| D | 12 | 13 | 14 |
...
What I want is to match the product model and size in df1 with the data in df2, so that I can add a new column with the price in the first data frame.
The result should be the following:
| SKU | Product | Model | Size | Price |
|-----|---------|-------|--------|-------|
| 1 | X | A | Small | 10 |
| 2 | X | B | Large | 10 |
| 3 | X | B | Medium | 9 |
...
How can I do this using R?