list_to_dataframe: Converts list to a dataframe in a sensible way

Description Usage Arguments Value Examples

Description

Given a list of dataframes with the same columns, this function will row bind them together, and if passed a col_name arguement, will produce a column containing their original element name

Usage

1
list_to_dataframe(l, col_name = NULL)

Arguments

l

list of dataframes to be converted into single dataframe

col_name

(optional) name of column to put element names under

Value

dataframe

Examples

1
2
3
split_iris <- split(iris, iris$Species)
list_out <- lapply(split_iris, function(x) {x['Species'] <- NULL; x})
list_to_dataframe(list_out, col_name = "Species")

Swarchal/Smisc documentation built on May 9, 2019, 3:23 p.m.