Description Usage Arguments Value Examples
Split a data set into training and testing data.
1 2 3 4 5 6 7 | split_data(data, n.train = 0.5, ...)
## S3 method for class 'data.frame'
split_data(data, n.train = 0.5, ...)
## Default S3 method:
split_data(data, n.train = 0.5, ...)
|
data |
A |
n.train |
An integer (number of) or proportion (proportion of) dictating how many observations to place in the training set. |
... |
ignored. |
Returns a named list of split data; a train
data set and a
test
data set.
1 2 3 4 5 6 7 8 9 | (split_dat <- split_data(mtcars))
split_dat$train
split_dat$test
split_data(mtcars, .8)
split_data(mtcars, 20)
split_data(LETTERS)
split_data(LETTERS, .4)
split_data(LETTERS, 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.