make_population: Makes a random population

Description Usage Arguments Value Author(s) Examples

View source: R/make_population.R

Description

This function takes a frequencies() object and returns a data.frame with the appropriate stratum and loci derived randomly.

Usage

1
make_population(x, N = 20, F = 0)

Arguments

x

A data.frame as returned by the frequencies() function. For a single locus, it has columns "Allele" and "Frequency" for multiple loci, it has a "Locus" column, and if it is to be subdivided into strata, you have a "Strata" column.

N

The number of individuals to create (default = 20). This is a 'per-stratum' estimate so if you have K strata the result will be K*N individuals.

F

The inbreeding index (Fis).

Value

A data.frame with individuals, loci, and potentially strata

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

1
2
3
4
5
  freqs <- c(0.55, 0.30, 0.15, 0.34, 0.34, 0.32)
  loci <- c(rep("TPI",3), rep("PGM",3))
  alleles <- c(LETTERS[1:3],LETTERS[8:10])
  f <- data.frame(Locus=loci, Allele=alleles, Frequency=freqs)
  make_population(f,N=20)

dyerlab/gstudio documentation built on May 30, 2021, 7:14 p.m.