Calculating variance-covariance matrix in R for Newick phylogeny

23 views Asked by At

I am trying to calculate the variance-covariance matrix for a known tree but the ape function, vcv.phylo is not giving me expected results.

library(ape)

phy1 <- read.tree(text =  "((a:6,b:6):4,c:10);")
plot(phy1, show.tip.label = TRUE, edge.width = 2)
ape::vcv.phylo(phy1)
   a  b  c
a 10  4  0
b  4 10  0
c  0  0 10

However, I am expecting an output of:

  a  b  c
a 10  6  4
b  6 10  4
c  4  4 10

I've been attempting different variations of this tree to get this output in the vcv matrix but I cannot seem to figure it out. Any ideas?

0

There are 0 answers