chunk_df | R Documentation |
chunk dataframes so easy to split for parallel processing
chunk_df(.gdf, ..., .nchunks = parallel::detectCores(), .as_list = TRUE)
.gdf |
(grouped) data frame |
... |
grouping variables, either a character vector or NSE-style column names |
.nchunks |
set number of chunks |
.as_list |
return df as a list |
library(dplyr) Theoph %>% chunk_df() Theoph %>% group_by(Subject) %>% chunk_df() Theoph %>% chunk_df(Subject) Theoph %>% chunk_df(c("Subject")) Theoph %>% chunk_df(Subject, .nchunks = 3) # to retain the df without being a list Theoph %>% chunk_df(Subject, .nchunks = 3, .as_list = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.