Description Usage Arguments Details Value See Also Examples
View source: R/prep_geno_data.R
Converts a dataframe containing your genetic data into the list format required for input to Stan. See details below for a description of the possible input formats.
1 | prep_geno_data(dataframe, type = c("bi", "multi"))
|
dataframe |
A dataframe containing your cline data. See details for possible formats. |
type |
Model type. Either "bi", for the binomial model, or "multi", for the multinomial model. |
The input dataframe can be a data frame or a tibble. Each row should contain the information for one sampling site. For the multinomial model, four named columns must be present, all other columns will be ignored:
transectDist: A numeric column, giving the position along the cline/transect for each site.
AA: The number of sampled individuals that are homozygous for the focal allele. Integer.
Aa: The number of sampled individuals that are heterozygotes. Integer.
aa: The number of sampled individuals that are homozygous for the non-focal allele. Integer.
For the binomial model, the user can supply either a data frame with the four columns above, or a dataframe with three named columns present (again, other columns are ignored):
transectDist: A numeric column, giving the position along the cline/transect for each site.
nFocalAllele: The allele count for the focal allele.
nTotalAlleles: The total number of alleles sampled (twice the number of diploid individiduals).
Your data in Stan-ready list format.
1 2 3 4 | ## Not run:
prep_geno_data(yourdata, type = "bi")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.