spatial_initial_split {tidysdm} | R Documentation |
Simple Training/Test Set Splitting for spatial data
Description
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.
Usage
spatial_initial_split(data, prop, strategy, ...)
Arguments
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 |
Value
An rsplit
object that can be used with the rsample::training and rsample::testing
functions to extract the data in each split.
Examples
set.seed(123)
block_initial <- spatial_initial_split(boston_canopy, prop = 1 / 5, spatial_block_cv)
testing(block_initial)
training(block_initial)
[Package tidysdm version 0.9.5 Index]