View source: R/genepop_sample.R
genepop_sample | R Documentation |
Stratified random sample of individuals from a Genepop file.
genepop_sample(genepop, nsample)
genepop |
the genepop data to be manipulated. This can be either a file path or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, or a single comma delimited row of loci names followed by the locus data. Populations are separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as as a single row (character). |
nsample |
vector or dataframe which defines the random stratified sampling. If nsample is an integer (e.g. 5) then nsample individuals will be selected from each population. If nsample is a fraction (0-0.9) then that percentage of individuals will be selected from each population. If nsample is a dataframe then the number or fraction associated with each population will be sampled. where the first column is the population and the second is the number to be sampled. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.