The reason for this is that the function looks for the first occurrence of "A" in the tip labels of tr, even with duplicated labels. By contrast, drop.tip() looks for all occurrences; the following command drops 2 tips even if a single label is given:
R> drop.tip(tr, "A")
Phylogenetic tree with 2 tips and 1 internal nodes.
Tip labels:
B, C
Rooted; no branch lengths.
The version of ape on GH (will be submitted to CRAN next week) now returns FALSE in both above commands. I assume this change will create no problem for the packages that use this function, but I thought it may be worth explaining this issue ahead of the CRAN submission. As usual, any feedback welcome.
Best,
Emmanuel
(Posted to: r-sig-phylo and GitHub)
Hi all,
is.monophyletic()
does not work correctly when some tip labels are duplicated. Here's a simple example:The two tips labelled "A" are not sister-lineages, but the current version of ape gives:
The reason for this is that the function looks for the first occurrence of "A" in the tip labels of
tr
, even with duplicated labels. By contrast,drop.tip()
looks for all occurrences; the following command drops 2 tips even if a single label is given:The version of ape on GH (will be submitted to CRAN next week) now returns
FALSE
in both above commands. I assume this change will create no problem for the packages that use this function, but I thought it may be worth explaining this issue ahead of the CRAN submission. As usual, any feedback welcome. Best, Emmanuel