Skip to content

add cols argument to rbindlist #7627

@MLopez-Ibanez

Description

@MLopez-Ibanez
x <- list(list(A=1,B="a",C=c(1,2)), list(A=2,B="b",C=c(3,4), D=0.1))
rbindlist(x, fill=TRUE)[, .(A, B,D)]

It would be very useful to be able to select which names or columns are selected from the input of rbindlist() before the data.table is created. Selecting those columns after it is created may lead to a different behavior, as the example above shows.

I'd like to do:

x <- list(list(A=1,B="a",C=c(1,2)), list(A=2,B="b",C=c(3,4), D=0.1))
rbindlist(x, cols=c("A","B","D"), fill=TRUE)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions