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.
Author
Rolf Simoes, rolfsimoes@gmail.com
Examples
# Retrieve a set of time series with 2 classes
data(cerrado_2classes)
# Print the labels of the resulting tibble
summary(cerrado_2classes)
#> # A tibble: 2 × 3
#> label count prop
#> <chr> <int> <dbl>
#> 1 Cerrado 400 0.536
#> 2 Pasture 346 0.464
# Sample by fraction
data_02 <- sits_sample(cerrado_2classes, frac = 0.2)
# Print the labels
summary(data_02)
#> # A tibble: 2 × 3
#> label count prop
#> <chr> <int> <dbl>
#> 1 Cerrado 80 0.537
#> 2 Pasture 69 0.463