table in R like so:
m[m1, on="tl", avgmfn:=i.avgmfn]
m[m1, on="tl", totallines:=i.totallines]
m[m2, on="tl", dutyfree:=i.dutyfree]
m[m3, on="tl", dutiable:=i.dutiable]
m[m4, on="tl", dutycode2021:=i.dutycode2021]
m[m5, on="tl", remain.dutiable:=i.remain.dutiable]
To update my main table m
based on a reference column tl
(tariff line) common to all data tables.
However m4
has multiple columns generated based on the number of years of duty codes.. so I would have dutycode2021
, dutycode2022
,dutycode2023
etc.
Does data.table
have functionality to automatically update all the column values in m
?
How can I do it without having to individually type the column names?
Any help appreciated!