safe_bind_rows: Stack data frames which may have differing types in the same...

View source: R/utils-query.R

safe_bind_rowsR Documentation

Stack data frames which may have differing types in the same column

Description

This function accepts a list of data frames and will stack them all and return a tbl_df with missing values filled in and all columns stacked regardless of if the datatypes were different within the same column.

Usage

safe_bind_rows(l, fill = TRUE, idcol = NULL, ...)

Arguments

l

list; A list containing data frames or lists that can be coerced to data frames.

fill

logical; TRUE fills missing columns with NA (default TRUE). When TRUE, use.names is set to TRUE.

idcol

character; Creates a column in the result showing which list item those rows came from. TRUE names this column ".id". idcol="file" names this column "file".

...

arguments passed to rbindlist

Value

tbl_df; all list elements stacked on top of each other to form a single data frame

Note

This function is meant to be used internally. Only use when debugging.


salesforcer documentation built on March 18, 2022, 6:26 p.m.