Description Usage Arguments Value Author(s) Examples
View source: R/diff-ml-utilities.R
Split large vector or dataframe to list class, which contian subset vectors or dataframe of origin vector or dataframe.
1 | 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
1 2 3 4 | data(iris)
irislist <- split_data(iris, 40)
dalist <- c(1:100)
dalist <- split_data(dalist, 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.