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