In converting alleles named like "1_1", "3_13", etc, the previous code was using lapply(x, as.integer) which returned NA (can't convert to integer) for all alleles, so I made some modifications in the function:
changed final conversion to convert any non-nucleotide set of loci to integers using factor conversion.
changed nucleotide conversion to convert based on factors (cleans up iterative calls to gsub)
removed error if non-integers or non-nucleotides are present since all types should be convertable now.
removed creation of 'diploid' logical (wasn't being used)
made alleles.name based on unique values rather than call to table and names of result
In converting alleles named like "1_1", "3_13", etc, the previous code was using lapply(x, as.integer) which returned NA (can't convert to integer) for all alleles, so I made some modifications in the function: