I'm working with a phylogenetic comparative method in R using the phylolm package and have encountered an error when attempting to fit a model. The error occurs even after I've attempted to align the data frame with the phylogenetic tree using bind.tip, match, and name.check functions. My goal is to model latitude as a function of various predictors, but phylolm is giving me the following warnings and errors:
lat.vif <- phylolm(Latitude~Elevation+Temperature+Precipitation,
data=colobine.sorted,phy=final.tree,model="lambda",lower.bound=0,upper.bound=1,boot=0)
Warning: will drop from the tree 127 taxa with missing dataWarning: drop all tips of the tree: returning NULLError in phylolm(Latitude ~ Elevation + Temperature + Precipitation, data = colobine.sorted, :
names of the data do not match with tip labels.
And I have 35 missing rows in my data, whose data are hard to collect.
$tree_not_data
[1] "Colobus_satanas" ....
I've attempted to use the function drop.tip, but it fails. What can I do to correctly align my data frame with the tree and resolve this error? What might be causing the discrepancy in names despite the previous matching steps? Thanks a lot!!