It is possible to perform permutation test of \(r^2\) by re-ordering the genotype through
R's sample function, obtaining the haplotype frequencies by gc.em
or genecounting, supplying the estimated haplotype frequencies to
the current function and record x2, and comparing the observed x2 and that from the
replicates.