As I mentioned before, don't use that code. It hasn't been tested and it appears that your version of a hapmap file is different than the one expected by the code I wrote five years ago.
I will attempt to help you out with the example file you've provided, but it may take a bit of time. In the meantime, I would encourage you to try and solve the problem yourself by reading the documentation for the genlight object in adegenet's "genomics" tutorial:
https://github.com/thibautjombart/adegenet/wiki/Tutorials. In essence, you want to create a data frame/matrix with only 0s, 1s, and 2s indicating the number of minor alleles for a given individual per SNP.