df_to_blocks | R Documentation |
Split a data frame into a list of blocks (either by rows or by columns)
df_to_blocks(DataFrame, blocks, byrow = TRUE)
DataFrame |
a data frame to split |
blocks |
either a list or a vector indicating the
blocks. If |
byrow |
logical. If |
A list of data frames
Gaston Sanchez
matrix_to_blocks
# say you have a data frame
iris_df = iris[c(1:3,51:53,101:103),]
# list defining the blocks
row_blocks = list(1:3, 4:6, 7:9)
col_blocks = c(2, 2, 1)
# split data into list of blocks (by rows)
df_to_blocks(iris_df, row_blocks)
# split data into list of blocks (by columns)
df_to_blocks(iris_df, col_blocks, byrow=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.