Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upError in update join when joining on factor #3559
Comments
|
idk how or why
|
|
Readability is in the eye of the beholder ;) But it's not "only" about readability; see e.g. the arguments for this kind of update join by @franknarf1 here. The idiom is also suggested by Arun here. |
|
unlock shallow copy of .SD when needed in joins in j seems to have fixed this issue as well.
Thanks a lot for your great work with this issue! |
I want to do an update join where I replace values in one data.table with values from another. For example, replace
NAin 'd1' with values from 'd2':When joining on a
factorvariable 'fac', it errors:Same operation but joining on a
character'char' works:Searched among the issues for the error and found .SD locked error using foverlaps after ordering by variable (exactly the same error) and .SD is locked for DT[, DT2[.SD]] joins (nearly the same error). The latter indeed looks similar, but it doesn't seem to be directly related to the
factorvscharacterissue described here.data.table_1.12.2