View source: R/stratify_random.R
stratify_random | R Documentation |
Splitting tool for cross-validation
stratify_random(occurrence_sf, nfolds = NULL)
occurrence_sf |
a sf object containing occurrence records |
nfolds |
number of desired output folds. |
See Examples.
Returns a sf dataframe containing fold designation for each point.
Cory Merow cory.merow@gmail.com
{
# load in sample data
library(S4DM)
library(terra)
library(sf)
# occurrence points
data("sample_points")
occurrences <- sample_points
occurrences <- st_as_sf(x = occurrences,coords = c(1,2))
random_folds <- stratify_random(occurrence_sf = occurrences,
nfolds = 5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.