Learn R Programming

sits (version 1.12.0)

.sits_sample_distances: Sample a percentage of a time series distance matrix

Description

Takes a sits tibble with different labels and returns a new tibble. For a given field as a group criterion, this new table contains a given number or percentage of the total number of samples per group. Parameter n indicantes the number of random samples with reposition. Parameter frac indicates a fraction of random samples without reposition. If frac > 1, no sampling is done.

Usage

.sits_sample_distances(distances_DT, frac)

Arguments

distances_DT

A data.table object with the distances associated to a time series.

frac

Percentage of samples to pick from a given group of data.

Value

A data.table with a fixed quantity of samples of informed labels and all other.