Description Usage Arguments Value Examples
View source: R/downsample_pairs.R
This discards individuals from the sample, randomly, until the desired number of samples is achieved, then it returns only those pairs in which both members are part of the retained samples.
1 | downsample_pairs(S, P, n)
|
S |
the tibble of samples with columns at least of |
P |
the tibble of pairs. Typically this will be what has been returned from
|
n |
The desired number of individuals (or instances, really, see below) to retain in the sample. |
This returns a list with two components as follows:
ds_samples
: A tibble like S
except having randomly removed individuals
so as to only have n left.
ds_pairs
: A tibble like P
except having removed any pairs that
include individuals that were not retained in the sample.
1 2 3 4 5 6 7 | # prepare some input
S <- three_pops_with_mig_slurped_results$samples
P <- compile_related_pairs(three_pops_with_mig_slurped_results$samples)
result <- downsample_pairs(S, P, n = 500)
# print the result
result
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.