traitecoevo / phyndr

Match tip and trait data
Other
9 stars 0 forks source link

Unmatched species should be dropped when no matches possible #5

Closed mwpennell closed 9 years ago

mwpennell commented 9 years ago

Simulate a tree

library(phyndr)
library(diversitree)
set.seed(3)
t <- tree.bd(c(1,0), max.taxa=6)
t$tip.label <- c("C_a", "B_a", "A_a", "B_b", "A_b", "A_c")

If only have data for one species of B and C, then phyndr_genus will correctly return a two taxon tree containing a representative from B and C

d_1 <- c("C_x", "B_x")
res_1 <- phyndr_genus(t,d_1)
res_1

If we don't have any data for A or B, then it should return a tree with only 1 tip, but it returns the original tree

d_2 <- c("C_x")
res_2 <- phyndr_genus(t,d_2)
res_2
richfitz commented 9 years ago

Need to check here that the taxonomic version more generally does actually delete species that don't match the trait data; it's possible I've done different things for the two different approaches. As much as possible the two should agree.