skembel / picante

R tools for integrating phylogenies and ecology
33 stars 17 forks source link

initial values for "corSymm" must be between -1 and 1 #37

Open sapuizait opened 8 months ago

sapuizait commented 8 months ago

Hi there

Excellent package! Its running nicely on my data with the exception of the phylogenetic signal! When I am using the phylocom data to identify traits following the phylogenetic signal it runs fine - but when I am usingmy data I get the following error:

Error in Initialize.corSymm(X[[i]], ...) : 
  initial values for "corSymm" must be between -1 and 1

Which I do not get because I think I am doing everything right; my tree is rooted, with tip labels and everything traits are in a dataframe and species are in the same order as the tree...

x.txt traits3.txt

Thanks in advance for helping me figure out whats wrong :)

skembel commented 8 months ago

Hello, your phylogeny has numerous edges with a length of zero, this error often happens when your tree contains zero-length branches, which cause problems for the calculation of phylogenetic signal. You can try to turn zero-length edges into polytomies and then recalculate using the function ape::di2multi to see if that helps.

sapuizait commented 8 months ago

Good to know - yeap, unfortunately I cannot avoid some 0 length branches! Thanks for the tip though, will give it a try and let you know!