Skip to contents

rbind_list combines a list of data frames or matrices into a single data frame or matrix, ensuring that all columns are present in the final result. If a data frame/matrix in the list is missing certain columns, those columns are added with NA values.

Usage

rbind_list(lst, allnames = NULL)

Arguments

lst

list of data frames or matrices, must contain at least two elements.

allnames

character, specifying the complete set of column names to include in the final result. If NULL, the function determines the unique column names from all input data frames/matrices. Default to NULL.

Value

A data frame or matrix (depending on the type argument) containing all rows from the input list, with columns aligned based on allnames. Missing values are filled with NA.