Updating data.table by inserting new rows that are different from old rows

前端 未结 3 444
面向向阳花
面向向阳花 2021-01-22 22:52

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

3条回答
  •  有刺的猬
    2021-01-22 23:31

    You can stack and uniqify:

    unique(rbind(dt1, dt2), by=c("Product", "Level", "Color"))
    

提交回复
热议问题