sample_fs: Sample the feasible set

Description Usage Arguments Value

View source: R/sample_fs.R

Description

Draw samples from the feasible set for an SAD.

Usage

1
sample_fs(dataset, nsamples, p_table = NULL)

Arguments

dataset

dataframe of the SAD for a single site; the result of load_dataset and then filtering to one community

nsamples

how many samples to draw. If the number of samples approaches the total number of elements in the feasible set, the samples may not all be unique. This function will only return unique samples, and so may not return nsamples samples if the feasible set is relatively small.

p_table

p table If provided, passes p table to feasiblesads to avoid re-generating it for every site

Value

long dataframe of simulated SADs in the same format as dataset, and the original dataset. Sims are distinguished from the observed via the source column (observed or sampled), and individual sims are identified with the sim column.


diazrenata/scadsanalysis documentation built on May 14, 2021, 6:59 p.m.