# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
snpset <- snpgdsSelectSNP(genofile, missing.rate=0.95)
snpgdsGDS2BED(genofile, bed.fn="test", snp.id=snpset)
# close the genotype file
snpgdsClose(genofile)
# delete the temporary files
unlink(c("test.bed", "test.bim", "test.fam"), force=TRUE)
Run the code above in your browser using DataLab