ericgoolsby / Rphylopars

Phylogenetic Comparative Tools for Missing Data and Within-Species Variation
28 stars 11 forks source link

std::bad_cast #44

Closed nick-youngblut closed 3 years ago

nick-youngblut commented 3 years ago

It appears that phylopars() has no check that the species column values and the tree tip labels actually match. If one provides a tree with the wrong labels on the tree, the user gets the uninformative error:

Error in tp(L = X_complete, R = as.matrix(as.double(dat)), Rmat = as.matrix(dat), : std::bad_cast
ericgoolsby commented 3 years ago

Thanks for pointing this (and other issues) out! The devel branch should provide an informative error now.

On a broader note -- I had to pause work on Rphylopars for a couple of years and I'm just now looking through the very helpful backlog of issues. I'll be pushing patches as a temporary fix, but I'm also working on a major update in which most of the package will be completely rewritten from scratch. I'll preserve backward compatibility as best as possible, but (what will eventually become) version 1.0 will hopefully be much more organized via usethis and testthat packages. :)

nick-youngblut commented 3 years ago

Thanks for the quick response and the great R package!