# NOT RUN {
data(Pinf)
iPinf <- recode_polyploids(Pinf)
# Note that the difference between the number of alleles.
nAll(Pinf)
nAll(iPinf)
# }
# NOT RUN {
library("ape")
# Removing missing data.
setPop(Pinf) <- ~Country
# Calculating Rogers' distance.
rog <- rogers.dist(genind2genpop(Pinf))
irog <- rogers.dist(recode_polyploids(genind2genpop(Pinf)))
# We will now plot neighbor joining trees. Note the decreased distance in the
# original data.
plot(nj(rog), type = "unrooted")
add.scale.bar(lcol = "red", length = 0.02)
plot(nj(irog), type = "unrooted")
add.scale.bar(lcol = "red", length = 0.02)
# }
Run the code above in your browser using DataLab