Bug: brownie.lite doesn't rearrange standard errors
Closed this issue · 1 comments
blasiusz commented
Dear Dr. Revell,
I found an issue with the brownie.lite
function, it doesn't use the names in the named vector argument called se
. So it only works properly if the se
vector contains the values in the order of the tips of the tree. This problem does not apply to the x
argument, that one is fine. The reason is that in the brownie.lite
function the x
variable is reordered with the line x <- x[tree$tip.label]
but such reordering is missing for se
. An easy solution would be to change to following lines:
if (!is.null(se))
se <- matchDatatoTree(tree, se, "se")
else {
To this:
if (!is.null(se)) {
se <- matchDatatoTree(tree, se, "se")
se <- se[tree$tip.label]
} else {
liamrevell commented
Fixed. Thanks for the report. Unfortunately, fix is not in current phytools version on CRAN (1.2-0). Will be in next CRAN release.