This is an efficient implementation of the common pattern of `do.call(rbind, dfs)` or `do.call(cbind, dfs)` for binding many data frames into one.
Data frames to combine.
Each argument can either be a data frame, a list that could be a data frame, or a list of data frames.
When row-binding, columns are matched by name, and any missing columns will be filled with NA.
When column-binding, rows are matched by position, so all data frames must have the same number of rows. To match by value, not position, see mutate-joins.
Data frame identifier.
When `.id` is supplied, a new column of identifiers is created to link each row to its original data frame. The labels are taken from the named arguments to `bind_rows()`. When a list of data frames is supplied, the labels are taken from the names of the list. If no names are found a numeric sequence is used instead.
from Seurat 3.0 A character vector of length(x = c(x, y)). Appends the corresponding values to the start of each objects' cell names.
`bind_rows()` and `bind_cols()` return the same type as the first input, either a data frame, `tbl_df`, or `grouped_df`.
The output of `bind_rows()` will contain a column if that column appears in any of the inputs.
data(se_mini)
se_mini_tidybulk = se_mini |> tidybulk()
bind_rows( se_mini_tidybulk, se_mini_tidybulk )
#> # A tibble: 5,270 × 9
#> .feature .sample count Cell.type time condition days dead entrez
#> <chr> <chr> <dbl> <chr> <chr> <lgl> <dbl> <dbl> <chr>
#> 1 ABCB4 SRR1740034 1035 b_cell 0 d TRUE 1 1 5244
#> 2 ABCB9 SRR1740034 45 b_cell 0 d TRUE 1 1 23457
#> 3 ACAP1 SRR1740034 7151 b_cell 0 d TRUE 1 1 9744
#> 4 ACHE SRR1740034 2 b_cell 0 d TRUE 1 1 43
#> 5 ACP5 SRR1740034 2278 b_cell 0 d TRUE 1 1 54
#> 6 ADAM28 SRR1740034 11156 b_cell 0 d TRUE 1 1 10863
#> 7 ADAMDEC1 SRR1740034 72 b_cell 0 d TRUE 1 1 27299
#> 8 ADAMTS3 SRR1740034 0 b_cell 0 d TRUE 1 1 9508
#> 9 ADRB2 SRR1740034 298 b_cell 0 d TRUE 1 1 154
#> 10 AIF1 SRR1740034 8 b_cell 0 d TRUE 1 1 199
#> # ℹ 5,260 more rows
tt_bind = se_mini_tidybulk |> select(time, condition)
se_mini_tidybulk |> bind_cols(tt_bind)
#> New names:
#> • `time` -> `time...5`
#> • `condition` -> `condition...6`
#> • `time` -> `time...10`
#> • `condition` -> `condition...11`
#> # A tibble: 2,635 × 11
#> .feature .sample count Cell.type time...5 condition...6 days dead entrez
#> <chr> <chr> <dbl> <chr> <chr> <lgl> <dbl> <dbl> <chr>
#> 1 ABCB4 SRR1740034 1035 b_cell 0 d TRUE 1 1 5244
#> 2 ABCB9 SRR1740034 45 b_cell 0 d TRUE 1 1 23457
#> 3 ACAP1 SRR1740034 7151 b_cell 0 d TRUE 1 1 9744
#> 4 ACHE SRR1740034 2 b_cell 0 d TRUE 1 1 43
#> 5 ACP5 SRR1740034 2278 b_cell 0 d TRUE 1 1 54
#> 6 ADAM28 SRR1740034 11156 b_cell 0 d TRUE 1 1 10863
#> 7 ADAMDEC1 SRR1740034 72 b_cell 0 d TRUE 1 1 27299
#> 8 ADAMTS3 SRR1740034 0 b_cell 0 d TRUE 1 1 9508
#> 9 ADRB2 SRR1740034 298 b_cell 0 d TRUE 1 1 154
#> 10 AIF1 SRR1740034 8 b_cell 0 d TRUE 1 1 199
#> # ℹ 2,625 more rows
#> # ℹ 2 more variables: time...10 <chr>, condition...11 <lgl>