Is it possible to combine chaining and assignment by reference in a data.table?
For example, I would like to do this:
DT[a == 1][b == 0, c := 2]
However, this leaves the original table unchanged, as a temporary table seems to be created after DT[a == 1] which is subsequently changed and returned.
I would rather not do
DT[a == 1 & b == 0, c := 2]
as this is very slow and I would also rather avoid
DT <- DT[a == 1][b == 0, c := 2]
as I would prefer to do the assignment by reference. This question is part of the question [1], where it is left unanswered.
[1] Conditional binary join and update by reference using the data.table package