split_data: Split Large Vector or DataFrame

Description Usage Arguments Value Author(s) Examples

View source: R/diff-ml-utilities.R

Description

Split large vector or dataframe to list class, which contian subset vectors or dataframe of origin vector or dataframe.

Usage

1
split_data(x, nums, chunks = NULL, random = FALSE)

Arguments

x

vector class or data.frame class.

nums

integer.

chunks

integer. use chunks if nums is missing. Note nums and chunks shouldn't concurrently be NULL, default is NULL.

random

bool, whether split randomly, default is FALSE, if you want to split data randomly, you can set TRUE, and if you want the results are reproducible, you should add seed before.

Value

the subset of x, vector or data.frame class.

Author(s)

Shuangbin Xu

Examples

1
2
3
4
data(iris)
irislist <- split_data(iris, 40)
dalist <- c(1:100)
dalist <- split_data(dalist, 30)

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.