[R] Ancestral state problem (length of phylogenetic and phenotypic data don't match)
Hannah west
hannah_west_i at live.co.uk
Fri Mar 13 16:21:46 CET 2015
Dear All,
I am trying to do an ancestral state reconstruction in R using the package 'ape'. I have tried trimming my tree in BayesTraits and in R itself, and the resulting tree reports as having 573 species tips, which is the same as my dataset. As far as I can tell everything is loading properly, but every time I try running the ACE codes R returns the following error message;
Error in ace(MCTree, phy = tree, type = "discrete", model = "ER") :
length of phenotypic and of phylogenetic data do not match.
The code I'm using is
ace.ER<-ace(MCTree,phy=tree,type="discrete",model="ER")
My data summary loads as
'data.frame': 573 obs. of 2 variables:
$ Species: Factor w/ 573 levels "Abeomelomys_sevia",..: 251 10 16 17 18 25 30 31 32 54 ...
$ MCAll : int 0 0 0 0 0 0 0 0 0 0 ...
My tree loads as
List of 4
$ edge : int [1:1144, 1:2] 574 575 576 576 577 577 578 578 579 579 ...
$ edge.length: num [1:1144] 64.6 27.3 55.2 3.6 51.6 33.3 18.3 0.1 18.2 18.2 ...
$ Nnode : int 572
$ tip.label : chr [1:573] "Abeomelomys_sevia" "Abrothrix_longipilis" "Abrothrix_olivaceus" "Acerodon_celebensis" ...
- attr(*, "class")= chr "phylo"
- attr(*, "order")= chr "cladewise"
And as you can see the tips and data strings should match in length.
Any help would be much appreciated. Thank you!
(This is my first submission to one of these help threads so let me know if I miss anything vital).
[[alternative HTML version deleted]]
More information about the R-help
mailing list