rbind_named_df_list: rbinds a named list of data.frames

rbind_named_df_listR Documentation

rbinds a named list of data.frames

Description

rbinds together data.frames in which the list name is turned into a column and bound to the data.frame becoming the first column of the data.frame

Usage

rbind_named_df_list(df_list, sum_col_name = "col_from_list")

Arguments

df_list

named list of data.frames

sum_col_name

colname of new column bound to data.frame

Value

a single data.frame row bound data.frame

Examples

library(dplyr)
library(delutils)
l <- list(data.frame(A=seq(1,5)), data.frame(A=seq(6, 7))) %>%
 setNames(., c('Cond1', 'Cond2'))
 rbind_named_df_list(l)

# Doesn't work because list contains matrix
## Not run: 
l <- list(data.frame(A=seq(1,5)),
 data.frame(A=seq(6, 7)),
 matrix(data=NA, ncol=1, nrow=5)) %>%
 setNames(., c('Cond1', 'Cond2', 'Cond3'))
 rbind_named_df_list(l)

## End(Not run)

lefeverde/lefutils documentation built on Sept. 18, 2024, 7:30 a.m.