Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbindlist support fill=TRUE with use.names=FALSE and use it in merge.R ToDo of #678 #5263

Merged
merged 12 commits into from
Nov 23, 2021
5 changes: 2 additions & 3 deletions R/merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ merge.data.table = function(x, y, by = NULL, by.x = NULL, by.y = NULL, all = FAL
yy = y[missingyidx]
othercolsx = setdiff(nm_x, by)
if (length(othercolsx)) {
tmp = rep.int(NA_integer_, length(missingyidx))
# TO DO: use set() here instead..
yy = cbind(yy, x[tmp, othercolsx, with = FALSE])
nx = make.unique(c(names(yy), othercolsx))
set(yy, NULL, tail(nx, length(othercolsx)), rep(list(NA), length(othercolsx)))
ben-schwen marked this conversation as resolved.
Show resolved Hide resolved
}
# empty data.tables (nrow =0, ncol>0) doesn't skip names anymore in new rbindlist
# takes care of #24 without having to save names. This is how it should be, IMHO.
Expand Down