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
{{ message }}
Repository navigation
[Request] Allow rbindlist(L, idcol = v) for any vector v of matching length #2159
Because my id column is not a character, I need to type it four (!) times and manually coerce it back to the correct class. There are other ways to handle it, but all the ones I can think of are quite clunky, like...
DT[, rbindlist(tab, idcol = f_id, idcol.name = "f_id")]
# or
DT[, rbindlist(tab, idcol = list(f_id = f_id))]
# or
DT[, rbindlist(tab, idcol = f_id)]
# with the name automatically inferred in the last case
This'd be better implemented with a separate function like unwrap(), for example. I remember having an implementation somewhere.. will have to check old local branches..
That sounds good. I could get used to a unnest(DT[, c("f_id", "tab")], id = "f_id") idiom or whatever. (I'm not familiar with unnest syntax and always keep a single column for an ID.)
Activity
MichaelChirico commentedon May 10, 2017
Agree with this. I swore I had already put up this FR in fact!
arunsrinivasan commentedon Jun 29, 2017
This'd be better implemented with a separate function like
unwrap(), for example. I remember having an implementation somewhere.. will have to check old local branches..arunsrinivasan commentedon Jun 29, 2017
Marking this as a dup of #2146. If you feel strongly that
rbindlistis the way to go, feel free to reopen and give your thoughts.franknarf1 commentedon Jun 29, 2017
That sounds good. I could get used to a
unnest(DT[, c("f_id", "tab")], id = "f_id")idiom or whatever. (I'm not familiar with unnest syntax and always keep a single column for an ID.)