Updating data.table by inserting new rows that are different from old rows
I have two data.table(dt1 & dt2). dt1 is past product data and dt2 is present product data. I want to create a third data.table that inserts new rows from dt2 into dt1 only when product characteristics(Level or Color) are different or Product itself is different. library(data.table) dt1 <- fread(' Product Level Color ReviewDate A 0 Blue 9/7/2016 B 1 Red 9/7/2016 C 1 Purple 9/7/2016 D 2 Blue 9/7/2016 E 1 Green 9/7/2016 F 4 Yellow 9/7/2016 ') dt2 <- fread(' Product Level Color ReviewDate A 1 Black 9/8/2016 B 1 Red 9/8/2016 C 5 White 9/8/2016 D 2 Blue 9/8/2016 E 1 Green 9/8/2016 F 4 Yellow 9/8