Randomly sample some number of observations from a [taxmap()] object. Weights
can be specified for observations or the taxa they are classified by. Any
variable name that appears in [all_names()] can be used as if it was a vector
on its own. See [dplyr::sample_n()] for the inspiration for this function.
Calling the function using the `obj$sample_n_obs(...)` style edits "obj" in
place, unlike most R functions. However, calling the function using the
`sample_n_obs(obj, ...)` imitates R's traditional copy-on-modify semantics,
so "obj" would not be changed; instead a changed version would be returned,
like most R functions.
obj$sample_n_obs(data, size, replace = FALSE,
taxon_weight = NULL, obs_weight = NULL,
use_supertaxa = TRUE, collapse_func = mean, ...)
sample_n_obs(obj, data, size, replace = FALSE,
taxon_weight = NULL, obs_weight = NULL,
use_supertaxa = TRUE, collapse_func = mean, ...)