if subsample = FALSE do nothing.
apply_subsampling(x, is_segclust, subsample, subsample_over, subsample_by)
data.frame to be subsampled
TRUE or FALSE whether the function was called from `segclust()` or `segmentation()`
if FALSE disable subsampling
maximum number of row accepted
subsampling parameters
a data.frame
else if subsample_by is missing, subsample only if nrow(x) > subsample_over, then it subsample with the minimum needed to get a data.frame smaller than subsample_over
if subsample_by is provided, use it to subsample.