I'm trying to achieve a relookup on a very large data sets (~25M rows, ~3000 cols), based on a large lookuptable as well (~15M rows) I need to change only matching values and keep non matching unchanged
here is a data sample
Lookup table
source target
A 1
B 2
C 3
D 4
... ...
Source datas (I don't know cols count until my table is loaded)
col1 col2 col3 ... coln
B C A ... ...
78 A D ... ...
A B 24 ... ...
... ... ... ... ...
Expected result
col1 col2 col3 ... coln
2 3 1 ... ...
78 1 4 ... ...
1 2 24 ... ...
... ... ... ... ...
I've been able to achieve this using nested loops but :
- This is very slow
- I know R is smarter than that
I've found some posts with an equivalent problematic, but none of the solutions seems to works in my case.
Any suggestions ?
Thanks
(Tried different solutions as explain here and here without success)