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
When merging two dt using merge.data.table and the key is not present in one of the two dts, data.table throws out an uninformative error:
Error in merge.data.table(test, manual, by = c("iso3c", "year"), all = T) :
Elements listed in `by` must be valid column names in x and y
which is not helpful as the user would then have to debug which key is not present in which dt. A more informative error would list all keys not present in all dts. For example:
> combined = test |>
+ left_join(manual, by = c('iso3c', 'year'))
Error in `left_join()`:
! Join columns in `y` must be present in the
data.
✖ Problem with `iso3c`.
#Output of sessionInfo()
The text was updated successfully, but these errors were encountered:
zhizhongpu
changed the title
[feature requestdiagnostic for merge.data.table when by = key is not present in dt being merged
[feature request] diagnostic for merge.data.table when by = key is not present in dt being merged
Oct 4, 2024
#
Minimal reproducible example
; please be sure to setverbose=TRUE
where possible!When merging two dt using merge.data.table and the key is not present in one of the two dts, data.table throws out an uninformative error:
which is not helpful as the user would then have to debug which key is not present in which dt. A more informative error would list all keys not present in all dts. For example:
#
Output of sessionInfo()
The text was updated successfully, but these errors were encountered: