Closed helenhe96 closed 6 years ago
Previously noted under Issue #100 that Trip/TripL did not work under BD model.
Trees generated by package diversitree
do not necessarily generate the same tip labels. I don't know if this was intentional or not.
Trip and TripL metrics require the two given trees to have the same number and same set of tip labels.
Trees generated w/ 10 tips:
> t1 <- speciation.model(theta, nsim=2, tips=10, model='bisse')[[1]]
> t2 <- speciation.model(theta, nsim=2, tips=10, model='bisse')[[2]]
> t1$tip.label
[1] "sp1_0" "sp2_0" "sp3_0" "sp4_0" "sp5_0" "sp6_0" "sp7_0" "sp8_0" "sp9_1" "sp10_1"
> t2$tip.label
[1] "sp1_0" "sp2_0" "sp3_0" "sp4_0" "sp5_0" "sp6_0" "sp7_0" "sp8_0" "sp9_0" "sp10_0"
@ArtPoon added the '_0' and '_1' tip states to the simulated trees within diversitree-wrappers.R
, but even when ignoring those appendages, trees with a higher number of tips do not necessarily have the same set of tip labels.
Trees generated w/ 50 tips:
> t1 <- speciation.model(theta, nsim=1, tips=50, model='bisse')[[1]]
> t2 <- speciation.model(theta, nsim=2, tips=50, model='bisse')[[2]]
> t1$tip.label
[1] "sp1_1" "sp2_1" "sp3_1" "sp4_0" "sp5_1" "sp6_0" "sp7_1" "sp8_1" "sp9_0" "sp10_0" "sp11_1" "sp12_1"
[13] "sp13_1" "sp14_1" "sp15_1" "sp16_0" "sp17_0" "sp18_0" "sp19_0" "sp20_0" "sp21_1" "sp22_0" "sp23_0" "sp24_0"
[25] "sp25_0" "sp26_0" "sp27_0" "sp28_0" "sp29_1" "sp30_0" "sp31_0" "sp32_0" "sp33_0" "sp34_0" "sp35_0" "sp36_0"
[37] "sp37_0" "sp38_0" "sp39_0" "sp40_0" "sp41_0" "sp42_0" "sp43_0" "sp44_1" "sp45_0" "sp46_0" "sp47_1" "sp48_1"
[49] "sp49_1" "sp50_1"
> t2$tip.label
[1] "sp1_0" "sp2_1" "sp3_1" "sp4_0" "sp5_0" "sp6_0" "sp8_1" "sp10_0" "sp11_0" "sp12_1" "sp13_0" "sp14_1"
[13] "sp15_0" "sp16_0" "sp17_0" "sp18_0" "sp19_0" "sp20_0" "sp21_0" "sp22_0" "sp23_0" "sp24_0" "sp25_0" "sp27_1"
[25] "sp28_1" "sp29_1" "sp30_0" "sp31_0" "sp32_0" "sp33_0" "sp34_0" "sp35_0" "sp36_0" "sp37_0" "sp38_0" "sp39_0"
[37] "sp40_0" "sp41_0" "sp42_1" "sp43_0" "sp44_0" "sp45_0" "sp46_0" "sp47_0" "sp48_0" "sp49_0" "sp50_0" "sp51_0"
[49] "sp52_0" "sp53_0"
I will be inserting a check that the tip labels for tree1 and tree2 in the Trip metric are the same so the error message is more explicit.
When I run this:
It produces this error: