Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am trying to calculate phylogenetic signal using the phylosig function from phytools, but I get this error:
Error in vcv.phylo(tree) : the tree has no branch lengths
However, when I check my tree, it says it does have branch lengths!
> MCC_genus_tree
Phylogenetic tree with 1160 tips and 1159 internal nodes.
Tip labels:
Anolis, Ornithorhynchus, Zaglossus, Tachyglossus, Rhynchocyon, Elephantulus, ...
Rooted; includes branch lengths.
What is going on? Any help would be appreciated.
EDIT:
My tree is a MCC tree downloaded from vertlife.
–
–
The answer is I goofed. My data had no names, so phylosig dropped all my tips!
This is how I fixed it:
data_with_names <- data_without_names$trait
names(data_with_names) <- data_with_names$species_names
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.