Description Usage Arguments Details See Also

Returns the row indices of `x`

that should go to training or testing.

1 2 |

`x` |
A vector used for splitting data |

`type` |
Character. How should data be split? Valid values are "random holdout" , "group holdout" or "kfold" |

`p` |
percentage of data that goes to training set (holdout) or to each fold (1/k) |

`groups` |
For "group holdout" and when x is numeric, this is the number of breaks in the quantiles |

`returnTrain` |
Logical indicating whether training data or testing data should be returned |

Three types of splits are currently implemented. "random holdout" randomly select `p`

percents of `x`

for the training set. 'group holdout" first groups `x`

into `groups`

quantiles and randomly samples within them. "kfold" creates k folds where p percent of the data is used for training in each fold. This function is a wrapper around two functions of `caret`

package: `createDataPartition`

and `createDataPartition`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.