library(phytools)
data(pwed_pd)
data(ligotree)
data(spcolmap)
#principal component analysis of size variables from ventral and dorsal anchors
pca2d_pwedv <- pca2d(pwed_pd[,1:55], sgn=-1, labcol=spcolmap$color,
phylo=TRUE, phy=ligotree, genus="L. ", bound.y=c(-0.2, 0.2),
bound.x1=c(-0.2,0.2), bound.x2 = c(-0.2,0.2))
pca2d_pwedd <- pca2d(pwed_pd[,56:110], sgn=-1, labcol=spcolmap$color,
phylo=TRUE, phy=ligotree, genus="L. ", bound.y=c(-0.2, 0.2),
bound.x1=c(-0.2,0.2), bound.x2 = c(-0.2,0.2))
#comparing size PC1 between ventral and dorsal anchors
hsplot(cbind(pca2d_pwedv$scores[,1], pca2d_pwedd$scores[,1]),
seqx=seq(-0.2,0.15,0.01), seqy=seq(-0.2,0.15,0.01),
xbound=c(-0.2,0.15), ybound=c(-0.2,0.15), y.label="Dorsal size PC1",
x.label="Ventral size PC1", labcol=spcolmap$color, type="ru",
sep1=0.1, sep2=0.1, phylo=FALSE, addline=c(0,1))
Run the code above in your browser using DataLab