rbindlist

0th

Percentile

Makes one data.table from a list of many

Same as do.call("rbind",l), but much faster.

Keywords
data
Usage
rbindlist(l)
Arguments
l
A list of data.table, data.frame or list objects.
Details

Each item of l may be either NULL (skipped), an empty object (0 rows) (skipped), or, have the same number of columns as the first non empty item. All items do not have to be the same type; e.g, a data.table may be bound with a list. The column types of the result are taken from the first non-empty item. If subsequent non-empty items have columns that mismatch in type, they are coerced to the first non-empty item's column types.

Value

  • An unkeyed data.table containing a concatenation of all the items passed in.

See Also

data.table

Aliases
  • rbindlist
Examples
DT1 = data.table(A=1:3,B=letters[1:3])
    DT2 = data.table(A=4:5,B=letters[4:5])
    l = list(DT1,DT2)
    rbindlist(l)
Documentation reproduced from package data.table, version 1.8.8, License: GPL (>= 2)

Community examples

mbfazel@gmail.com at Jul 13, 2019 data.table v1.12.2

```{r rbindList} DT1 = data.frame(A=1:3,B=letters[1:3]) rownames(DT1) <- paste0("row_",1:3) DT2 = data.frame(A=4:5,B=letters[4:5]) rownames(DT2) <- paste0("row_",4:5) l = list(DT1,DT2) res <- rbindlist(l) rownames(res) ```