I have following data frame in R
Amount Transaction_Type
62.81 1
6.66 2
19.9 3
24.02 2
24.02 2
45.2 1
19.76 3
The other dataframe I have is following
Transaction Transaction_Type
CARD 1
CASH 2
VOUCHER 3
I want to replace Transaction values in the first dataframe,so it will look like following
Amount Transaction_Type
62.81 CARD
6.66 CASH
19.9 VOUCHER
24.02 CASH
24.02 CASH
45.2 CARD
19.76 VOUCHER
Please help.
df1$Transaction_Type <- df2[match(df1$Transaction_Type, df2$Transaction_Type), 1]?