This would allow mimicking of transform / mutate behavior:
dt.a <- data.table(a=1:3)
dt.b <- dt.a[, b:=5:7, cp=T]
dt.b is now a new object with two columns, whereas dt.a remains a one column dt. While the reference nature of data.table is fantastic most of the times sometimes it can be a little annoying.
Simple work arounds exist so this is not high priority:
Although maybe the ideal solution would be if data.table detects it is being used as part of an assignment, not to do the modification by reference (though that will likely break lots of existing code...).
This would allow mimicking of
transform/mutatebehavior:dt.bis now a new object with two columns, whereasdt.aremains a one columndt. While the reference nature ofdata.tableis fantastic most of the times sometimes it can be a little annoying.Simple work arounds exist so this is not high priority:
Although maybe the ideal solution would be if
data.tabledetects it is being used as part of an assignment, not to do the modification by reference (though that will likely break lots of existing code...).