Skip to contents

Generates haplotype data from a haplotype object.

Usage

hapsim_simple(n, hap, seed = NULL)

Arguments

n

The number of haplotypes to generate.

hap

A haplotype object containing allele frequencies and covariance matrix.

seed

An optional seed for reproducibility.

Value

A matrix of haplotype data, where rows correspond to haplotypes and columns to loci.

Details

The function generates haplotype data based on the allele frequencies and covariance matrix provided in the `hap` object. It uses a multivariate normal distribution to generate the haplotypes.

Examples

# Example usage:
hap <- list(freqs = c(0.1, 0.2), cov = matrix(c(1, 0.5, 0.5, 1), nrow = 2))
hapsim_simple(n = 10, hap = hap, seed = 123)
#> Error in hapsim_simple(n = 10, hap = hap, seed = 123): could not find function "hapsim_simple"