I am using the package mcmcglmm and trying to calculate the inverse of the summed matrix of phylogenetic correlation (which will feed into a MCMCglmm). I have a phylogenetic tree 'tree' and initially ran the following:
inv.phylo <- inverseA(pedigree=tree, nodes="ALL", scale=TRUE, reduced = FALSE)
This threw up errors relating to the format of my phlogenetic tree, so I then made the tree ultrametric and rooted the tree (as requested) using the code:
tree.UM <- chronos(tree)
tree.root <- root(tree.UM, "Ovibos_moschatus", resolve.root=TRUE)
Now when I run:
inverseA(pedigree=tree.root, nodes="ALL", scale=TRUE, reduced = FALSE)
I get the error:
Error in pedigree[, 2] : incorrect number of dimensions
I've noted that tree.root has one more edge and node than tree, but cannot work out if this is 1) causing the problem, or 2) what to do about it if it is? So far I've tried running chronos() and root() the other way round, and using chronoMPL() instead of chronos(). Everything I have read indicates that inverseA() should work on a phylo object, which is what tree.root is, so I cannot afthom why it does not like it? Can anyone help me to get inverseA() to run?
Thanks in advance