Description Usage Arguments Value Author(s) See Also Examples
Split a data frame into a list of blocks (either by rows or by columns)
1 | 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
1 2 3 4 5 6 7 8 9 10 11 12 | # 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.