liamrevell / phytools

GNU General Public License v3.0
207 stars 56 forks source link

feature request-gradient information in biplot.phyl.pca #57

Open Jigyasa3 opened 4 years ago

Jigyasa3 commented 4 years ago

Hey @liamrevell @KlausVigo

Is it possible to add metadata information of the data in the biplot.

For example, library(phytools) library(coda.base) tree<-pbtree(n=26,tip.label=LETTERS) #from biplot.phyl.pca blog plost X<-fastBM(tree,nsim=4,bounds=c(1,10)) #bounds added to have positive values only X2<-as.matrix(dist(X, method="aitchison")) #distance matrix in Aitchison distance values<-as.factor(c("wood","soil")) #gradient information Y<-as.vector(rep(values,len=nrow(X2))) #gradient information mapped on X2 matrix obj<-phyl.pca(tree,X2) #works, gives the ordinates biplot(obj,Y) #gives an error ofcourse

I am looking for a way to get a biplot with information of vector Y plotted on the biplot. Any suggestions?