I would like to do a vlookup a lookup table in R, hence would like to use merge for that.
The data table looks like this:
The mapping table looks like this:
I want to do a vlookup based on the id_type column and type of asset.
My code looks as such:
base1 <- (merge(MappingTable, inputData, by = 'Id_type'))
When I do so, I get this error:
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
Need some guidance on this.