make_geno: Create a genotype or many genotypes in HWE

View source: R/simulate_phenotypes.R

make_genoR Documentation

Create a genotype or many genotypes in HWE

Description

Under Hardy Weinberg a genotype is binomially distributed, with p = allele frequency

Usage

make_geno(n, p)

Arguments

n

Sample size

p

Array of allele frequencies to simulate. Can be a single value.

Value

Array or matrix of genotypes

Examples

## Not run: 
g <- make_geno(100, 0.5) # To make a single genotype
g <- make_geno(100, c(0.5, 0.3, 0.6)) # To make 3 genotypes in a matrix

## End(Not run)

thomasbattram/usefunc documentation built on April 24, 2023, 1:46 p.m.