View source: R/createDataPartition.R
createDataPartition | R Documentation |
partitions a dataset into a test set and cross validation sets. createDataPartition() is not randomized, therefore df should be randomized before creating the partition!
createDataPartition(df, cross_validation_val, test_size = 0.2)
df |
data frame |
cross_validation_val |
number of sets for k-fold cross validation |
test_size |
size of test set (default=.8) |
partitioned dataset
{ # Example with the preloaded mtcars dataset df<-mtcars partition <- SVHM:::createDataPartition(mtcars, 4, .2) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.