generate_subsamples {biosampleR} | R Documentation |
Generate subsamples of a data frame with a number of sites between a minimum and maximum value.
Description
Generate subsamples of a data frame with a number of sites between a minimum and maximum value.
Usage
generate_subsamples(
data,
min_sites = 1,
max_sites = nrow(data),
step = 1,
reps = 100,
summary = TRUE,
seed = sample(0:9999, 1)
)
Arguments
data |
A data frame of count data, with sites as rows and species as columns. |
min_sites |
The minimum number of sites to include in a subsample. |
max_sites |
The maximum number of sites to include in a subsample. Defaults to the number of sites in the original data set. |
step |
The number of sites to increase by at each iteration. |
reps |
The number of subsamples with a given number of sites to create. |
summary |
A logical indicating whether to calculate summary indices
using |
seed |
A random seed to use for reproducibility. |
Value
A list of lists of data frames, if summary = FALSE
, each data
frame is a subsample of the original data set. If summary =
TRUE
, each data frame is a subsample of the original data set with
diversity indices calculated using
calc_diversity_indices
.
Examples
ss <- generate_subsamples(BCI,
min_sites = 1,
max_sites = 5,
step = 1,
reps = 2)