Learn R Programming

tbltools (version 0.1.0)

bind_rows_data: Bind rows

Description

Convenient wrapper around do.call("rbind", ...) that (a) sets the 'quote' argument to TRUE and (b) fills data frames with missing columns with NAs of the appropriate class.

Usage

bind_rows_data(..., fill = FALSE)

Arguments

...

Input data frames or list of data frames

fill

Logical indicating whether to fill missing columns in data frames with missing values.

Value

The list collapsed into a single data frame

Examples

Run this code
# NOT RUN {
## list of data frames with inconsistent columns
x <- as_tbl_data(mtcars[1:3, ])
xx <- x
xx$y <- "a"
l <- list(x, xx, mtcars)

## bind rows and fill missing columns with NAs
bind_rows_data(l, fill = TRUE)

# }

Run the code above in your browser using DataLab