powered by
Use chunk_by_id to split up a data set by the ID column; use chunk_by_row split a data set by rows.
ID
chunk_by_id(data, nchunk, id_col = "ID", mark = NULL)chunk_by_cols(data, nchunk, cols, mark = NULL)chunk_by_row(data, nchunk, mark = NULL)
chunk_by_cols(data, nchunk, cols, mark = NULL)
chunk_by_row(data, nchunk, mark = NULL)
A list of data frames.
A data frame.
The number of chunks.
Character name specifying the column containing the ID for chunking.
When populated as a character label, adds a column to the chunked data frames with that name and with value the integer group number.
A character vector of columns to use for deriving ID to use for chunking.
x <- expand.grid(ID = 1:10, B = rev(1:10)) chunk_by_id(x, nchunk = 3) chunk_by_row(x, nchunk = 4)
Run the code above in your browser using DataLab