Sample genotype without error
Arguments
- n
number of samples
- p
list of genotype probabilities or vector of length 3 for single locus
Examples
Z <- sample_profiles_without_error(n = 2, p = c(0.25, 0.25, 0.5))
to012(Z)
#> [,1]
#> [1,] 1
#> [2,] 2
Z <- sample_profiles_without_error(n = 5, p = list(
c(0.25, 0.25, 0.5), c(0.1, 0.8, 0.1)))
Z
#> [[1]]
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 1 0
#> [3,] 1 1
#> [4,] 0 1
#> [5,] 0 1
#>
#> [[2]]
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#> [3,] 0 1
#> [4,] 1 1
#> [5,] 1 0
#>
to012(Z)
#> [,1] [,2]
#> [1,] 2 1
#> [2,] 1 1
#> [3,] 2 1
#> [4,] 1 2
#> [5,] 1 1