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, cex=0.3, font=1, edge.col="Blue")
If I try edge.col=c("red","green","blue")
I run into following error :
Error in if (use.edge.length) unrooted.xy(Ntip, Nnode, z$edge, z$edge.length, :
argument is not interpretable as logical
Ill appreciate any help!