Different color for different cluster in a tree using adegenet R package
问题 I am using the R package adegenet to plot the neighbor-joining tree. In my file I have 20,000 columns and 500 rows. Rows correspond to individuals. My first column is Population ID and second column is Individual ID. Columns contain values 0,1 & 2. I am able to plot a tree in one color, but depending upon the population I want every cluster to be a different color. This is what I did, If "dat" is my data file,then D<-dist(as.matrix(dat)) tre<-nj(D) plot(tre, type = "unr", show.tip.lab = TRUE,