<pre class="r"><code>set.seed(123)
p = seq(0.1,0.9,length=9)
x = r_haploid_genotypes(20,p)
p</code></pre>
<pre><code>[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9</code></pre>
<pre class="r"><code>x </code></pre>
<pre><code>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
 [1,]    0    0    0    1    1    1    1    0    1
 [2,]    0    1    0    1    1    1    0    1    1
 [3,]    0    1    1    1    1    0    1    1    1
 [4,]    0    0    0    1    1    0    0    1    1
 [5,]    0    0    0    0    0    1    