generate_data <- function(n_list, n_columns, n_rows) { exe <- function(n_columns = n_columns, n_rows = n_rows) { as.data.frame( replicate( n = n_columns, expr = rnorm(n = n_rows) ) ) } n_columns <- rep( x = n_columns, times = n_list ) lapply( X = n_columns, FUN = exe, n_rows = n_rows ) } list_of_dataframes <- generate_data( n_list = 5, n_columns = 5, n_rows = 5 )
do.call( what = "rbind", args = list_of_dataframes )
dplyr::bind_rows( list_of_dataframes ) # adding the .id argument creates a new column # with labels for each list # dplyr::bind_rows( # list_of_dataframes, # .id = "column_label" # )
data.table::rbindlist( l = list_of_dataframes )
microbenchmark::microbenchmark( base = do.call( what = "rbind", args = list_of_dataframes ), dplyr = dplyr::bind_rows( list_of_dataframes, .id = "column_label" ), data.table = data.table::rbindlist( l = list_of_dataframes ), times = 1000 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.