Learn R Programming

tidytable (version 0.5.1)

bind_rows.: Bind data.tables by row and column

Description

Bind multiple data.tables into one row-wise or col-wise.

Usage

bind_rows.(..., .id = NULL, use.names = TRUE, fill = TRUE)

dt_bind_rows(..., .id = NULL, use.names = TRUE, fill = TRUE)

bind_cols.(...)

dt_bind_cols(...)

Arguments

...

data.tables or data.frames to bind

.id

If TRUE, an integer column is made as a group id

use.names

If TRUE, makes sure column names align

fill

If TRUE, fills missing columns with NA

Examples

Run this code
# NOT RUN {
df1 <- data.table(x = c(1,2,3), y = c(3,4,5))
df2 <- data.table(x = c(1,2,3), y = c(3,4,5))

df1 %>%
  bind_rows.(df2)

bind_rows.(list(df1, df2))

df1 %>%
  bind_cols.(df2)

bind_cols.(list(df1, df2))
# }

Run the code above in your browser using DataLab