split_vec: Split object in blocks

Description Usage Arguments Value Examples

View source: R/split.R

Description

Split object in blocks

Usage

1
2
3
split_vec(x, block_len, nb_split = ceiling(length(x)/block_len))

split_df(df, block_len, nb_split = ceiling(nrow(df)/block_len))

Arguments

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.

Value

A list with the splitted objects.

Examples

1
2
split_vec(1:10, block_len = 3)
str(split_df(iris, nb_split = 3))

bigparallelr documentation built on Oct. 2, 2021, 5:08 p.m.