I recently discovered data.table and I love its ability to modify values in place, because I am usually working with datasets sized around 10-15GB.
While I was able to do a left/right join with modification in place, I could not find a solution how to do it with a full(outer) join (i.e. take all values from table A and all values from table B and fill missing with NA, like dplyr::full_join)
I found a stackoverflow answer here that shows how to do this for a left/right join:
A <- data.table(a = 1:4, b = 12:15)
B <- data.table(c = 2:3, b = 13:14)
B[A, b.A:= i.b, on = c(c = "a")]
I know that it is possible to use merge(A, B, by.x = "a", by.y = "c", all = T)
for a full_join, but then I need to assign the result to a variable again and this would require a lot of memory in my case. I also found another interesting approach here, but I would also need to create a new variable in this case.
Any help greatly appreciated!