View source: R/spatial_initial_split.R
spatial_initial_split | R Documentation |
spatial_initial_split
creates a single binary split of the data into a
training set and testing set. All strategies from the package spatialsample
are available; a random split from that strategy will be used to generate the
initial split.
spatial_initial_split(data, prop, strategy, ...)
data |
A dataset (data.frame or tibble) |
prop |
The proportion of data to be retained for modelling/analysis. |
strategy |
A sampling strategy from |
... |
parameters to be passed to the |
An rsplit
object that can be used with the rsample::training and
rsample::testing functions to extract the data in each split.
set.seed(123)
block_initial <- spatial_initial_split(boston_canopy,
prop = 1 / 5, spatial_block_cv
)
testing(block_initial)
training(block_initial)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.