Split object in blocks
Split object in blocks
split_vec(x, block_len, nb_split = ceiling(length(x)/block_len)) split_df(df, block_len, nb_split = ceiling(nrow(df)/block_len))
x |
Vector to be divided into groups. |
block_len |
Maximum length (or number of rows) of each block. |
nb_split |
Number of blocks. Default uses the other 2 parameters. |
df |
Data frame to be divided into groups. |
A list with the splitted objects.
split_vec(1:10, block_len = 3) str(split_df(iris, nb_split = 3))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.