split_vec {bigparallelr}R Documentation

Split object in blocks

Description

Split object in blocks

Usage

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

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


[Package bigparallelr version 0.3.2 Index]