vpart | R Documentation |
Extract a random partition from an input dataset.
vpart(data, p, shuffle = FALSE, ...)
data |
An input data.frame. |
p |
Proportion of rows to be extracted from the input dataset. |
shuffle |
A logical value. If TRUE, the input rows are randomly shuffled before data partitioning. |
... |
Currently ignored. |
A list of 2 data.frames:
"training.set", the portion of the input data defined by p;
"validation.set", the portion of the input data defined by 1-p.
Fernando Palluzzi fernando.palluzzi@gmail.com
buildPredictor
,
# Extract a subset of 300 subjects and an outcome vector of length 30 # from the default simulated dataset x <- mosaic::sample(mpm.us, 300, replace = FALSE, prob = NULL) # Data partitioning x <- vpart(x, p = 0.75) print(dim(x$training.set)) print(dim(x$validation.set))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.