data("dna.obj")
x<-dna.obj
h<-haplotypes::haplotype(x)
### Statistical parsimony with 95% connection limit
p<-parsimnet(x)
#randomly generated populations
pop<-c("pop1","pop2","pop3","pop4","pop5","pop6","pop7","pop8")
set.seed(5)
pops<-sample(pop,nrow(x),replace=TRUE)
## Plotting with default parameters.
pieplot(p,h,1, pops)
## Add legend with default parameters.
pielegend(p,h,1,pops)
## Change colors for the populations.
#8 colors for 8 populations
cols<-colors()[c(30,369,552,558,538,642,142,91)]
pieplot(p,h,1, pops,col=cols)
pielegend(p,h,1,pops,col= cols)
Run the code above in your browser using DataLab