You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, when there are multiple matches in a merge, I prefer to just drop those matches entirely as a curb against mismatching (e.g., there are multiple matches when I expected there to be only 1).
As a workaround, I find myself doing something like dt_1[dt_2[,if (.N==1) .SD,by=key],...], but this can be slow if there are many keys and dt_2 is large; better, it seems, would be to just discard the .N>1 cases via mult in [.data.table.
The text was updated successfully, but these errors were encountered:
@jangorecki yes, very much in the same vein as that thread--basically generalizing the possible returns for mult. Would also be fine to see something like mult=5.
Sometimes, when there are multiple matches in a merge, I prefer to just drop those matches entirely as a curb against mismatching (e.g., there are multiple matches when I expected there to be only 1).
As a workaround, I find myself doing something like
dt_1[dt_2[,if (.N==1) .SD,by=key],...]
, but this can be slow if there are manykey
s anddt_2
is large; better, it seems, would be to just discard the.N>1
cases viamult
in[.data.table
.The text was updated successfully, but these errors were encountered: