# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
genofile
chr <- read.gdsn(index.gdsn(genofile, "snp.chromosome"))
pos <- read.gdsn(index.gdsn(genofile, "snp.position"))
set.seed(1000)
flag <- snpgdsApartSelection(chr, pos, min.dist=250000, verbose=TRUE)
table(flag)
# close the genotype file
snpgdsClose(genofile)
Run the code above in your browser using DataLab