View source: R/sits_sample_functions.R
sits_sample | R Documentation |
Takes a sits tibble with different labels and returns a new tibble. For a given field as a group criterion, this new tibble contains a percentage of the total number of samples per group. If frac > 1 , all sampling will be done with replacement.
sits_sample(data, frac = 0.2, oversample = TRUE)
data |
Sits time series tibble (class = "sits") |
frac |
Percentage of samples to extract (range: 0.0 to 2.0, default = 0.2) |
oversample |
Logical: oversample classes with small number of samples? (TRUE/FALSE) |
A sits tibble with a fixed quantity of samples.
Rolf Simoes, rolf.simoes@inpe.br
# Retrieve a set of time series with 2 classes
data(cerrado_2classes)
# Print the labels of the resulting tibble
summary(cerrado_2classes)
# Sample by fraction
data_02 <- sits_sample(cerrado_2classes, frac = 0.2)
# Print the labels
summary(data_02)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.