split_data {MicrobiotaProcess} | R Documentation |
Split large vector or dataframe to list class, which contian subset vectors or dataframe of origin vector or dataframe.
split_data(x, nums, chunks = NULL, random = FALSE)
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. |
the subset of x, vector or data.frame class.
Shuangbin Xu
data(iris) irislist <- split_data(iris, 40) dalist <- c(1:100) dalist <- split_data(dalist, 30)