I'm curious if there is a function in R that can accomplish the task of looking up a corresponding value from another dataset and replacing several columns of data based on that lookup table.
The data would look like this:
ID value_1 value_2 value_3
----------------------------
1 A - B
2 A C A
3 C A C
4 - - -
The lookup table would look like this:
letters amount
---------------
A 5
B 6
C 20
and the intended output should look something like this:
ID value_1 value_2 value_3
----------------------------
1 5 - 6
2 5 20 5
3 20 5 20
4 - - -