matrix in which genotypes are coded as 0, 1 or 2 copies of the minor allele.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co">#define a function to convert the value into 0,1,2</span>
convertToNumeric &lt;-<span class="st"> </span><span class="cf">function</span>(x){
gdat &lt;-<span class="st"> </span><span class="kw">matrix</span>(<span class="ot">NA</span>,<span class="dt">nrow =</span> <span class="kw">nrow</span>(x), <span class="dt">ncol =</span> <span c