A user today reported encountering the following error while using the phytools function make.simmap:
Error in if (names(map)[length(map)] == node.states[j, 2]) accept = TRUE :
missing value where TRUE/FALSE needed
In addition: Warning message:
In sqrt(diag(solve(h))) : NaNs produced
It turns out that this is just due to the fact that the data y is a data frame, with species names in rows, rather than a vector with names(...) equal to the species names. Perhaps in the future I will modify make.simmap to rectify this problem, but for no this can be circumvented as follows:
> z<-y; names(z)<-rownames(y)
I figured that this was probably a sufficiently common problem for users of make.simmap to repeat on the blog.