I used the K-mer GWAS tool to do the GWAS [https://www.nature.com/articles/s41588-020-0612-7]
If one gets any significant association between a K-mer and the phenotype, then a presence/absence pattern of that K-mer among the samples can be obtained. The presence/absence pattern is in binary form. I saw in the paper that they used a formula for getting the LD value under the section "Calculation of Linkage Disequilibrium". I asked the author about the input files. They said they only used that presence/absence pattern table and applied that formula in R to obtain the LD value. But I am not sure how to use that formula for estimating LD in R. Do you have any idea?