Skip to contents

The function takes a list of data frames and stacks them into a single data frame. It ensures that all columns from the input data frames in the list are included in the output, filling in missing columns with NA values where necessary.

Usage

mm_stack_df(df_list)

Arguments

df_list

list of data frame to be stacked

Value

data frame

Examples


x <- data.frame(age = 15, fruit = "Apple", weight = 12)
y <- data.frame(age = 51, fruit = "Tomato")
z <- data.frame(age = 26, fruit = "Lemo", weight = 12, height = 45)
alldf <- list(x,y,z)
mm_stack_df(alldf)
#> # A tibble: 3 × 4
#>   age   fruit  weight height
#>   <chr> <chr>  <chr>  <chr> 
#> 1 15    Apple  12     NA    
#> 2 51    Tomato NA     NA    
#> 3 26    Lemo   12     45