Hi Bret,

This is fixed and will be in the next release. In the meantime, you can edit 
the function and change the last line to:

    all.equal(tips, desc)

Thanks for the report. 

Cheers,

Emmanuel
-----Original Message-----
From: Bret Larget <lar...@stat.wisc.edu>
Sender: r-sig-phylo-boun...@r-project.org
Date: Thu, 22 Mar 2012 18:05:24 
To: <jnylan...@users.sourceforge.net>
Cc: <r-sig-phylo@r-project.org>
Subject: [R-sig-phylo] behavior of is.monophyletic()


Please note the following discrepency in the behavior of 
is.monophyletic().

------------------------------------------------------------------
> foo = read.tree(text="((1:2.0,(2:1.0,3:1.0):1.0):1.0,4:3.0);")
> is.monophyletic(foo,tips=2:3)
[1] TRUE
> is.monophyletic(foo,tips=c(2,3))
[1] FALSE
-----------------------------------------------------------------

I am aware that the function works properly when tips are specified as 
characters.  However, the documentation states that tips may be specified 
as numeric.  The difference between c(2,3) and 2:3 is that the former is 
class numeric and the latter is class integer.  I cannot think of any good 
reason for why this distinction should result in different behavior of the 
function.  It would be best if the function worked correctly in all 
situations, but in particular when the input matches the usage specified 
by the documentation.

--------------------------------------------------------------------------
Usage

is.monophyletic(phy, tips, reroot = !is.rooted(phy), plot = FALSE, ...)

Arguments

phy      a phylogenetic tree description of class "phylo".
tips     a vector of mode numeric or character specifying the tips to be
                           ^^^^^^^
          tested.
reroot   a logical. If FALSE, then the input tree is not unrooted before
          the test.
plot     a logical. If TRUE, then the tree is plotted with the specified
          group tips highlighted.
...      further arguments passed to plot.
-------------------------------------------------------------------------


I hope that this can be corrected in a future version of ape.

-Bret Larget

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to