[med-svn] [r-cran-ape] 01/03: Imported Upstream version 3.1-2

Dylan Aïssi bob.dybian-guest at moszumanska.debian.org
Tue May 27 17:24:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

bob.dybian-guest pushed a commit to branch master
in repository r-cran-ape.

commit 8ab78152968df2d8454fa7fe04b845855bafbf69
Author: Dylan Aïssi <bob.dybian at gmail.com>
Date:   Tue May 27 19:16:14 2014 +0200

    Imported Upstream version 3.1-2
---
 COPYING                    | 340 +++++++++++++++++++++++++++++++++++++++++++++
 DESCRIPTION                |   8 +-
 MD5                        |  43 +++---
 NEWS                       |  46 ++++++
 R/CDF.birth.death.R        |   4 +-
 R/DNA.R                    |   6 +-
 R/SlowinskiGuyer.R         |   1 -
 R/ace.R                    |  44 ++++--
 R/all.equal.phylo.R        |  12 +-
 R/chronos.R                |  11 +-
 R/cophyloplot.R            |  26 ++--
 R/dist.topo.R              |   4 +-
 R/plot.phylo.R             | 194 +++++++++++++++-----------
 R/read.GenBank.R           |   6 +-
 R/read.nexus.R             |  42 +++---
 build/vignette.rds         | Bin 192 -> 192 bytes
 data/hivtree.newick.rda    | Bin 2189 -> 2189 bytes
 data/landplants.newick.rda | Bin 574 -> 575 bytes
 data/opsin.newick.rda      | Bin 445 -> 445 bytes
 inst/doc/MoranI.pdf        | Bin 126448 -> 256525 bytes
 man/ace.Rd                 |  39 +++++-
 man/plot.phylo.Rd          |  17 +--
 src/bionjs.c               |  21 ++-
 23 files changed, 676 insertions(+), 188 deletions(-)

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..3912109
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+

+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+

+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+

+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+

+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/DESCRIPTION b/DESCRIPTION
index c51419d..cfa009d 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: ape
-Version: 3.1-1
-Date: 2014-03-06
+Version: 3.1-2
+Date: 2014-05-27
 Title: Analyses of Phylogenetics and Evolution
 Authors at R: c(person("Emmanuel", "Paradis", role = c("aut", "cre", "cph"), email = "Emmanuel.Paradis at ird.fr"),
   person("Ben", "Bolker", role = "aut"),
@@ -28,7 +28,7 @@ ZipData: no
 Description: ape provides functions for reading, writing, plotting, and manipulating phylogenetic trees, analyses of comparative data in a phylogenetic framework, ancestral character analyses, analyses of diversification and macroevolution, computing distances from allelic and nucleotide data, reading and writing nucleotide sequences, and several tools such as Mantel's test, generalized skyline plots, graphical exploration of phylogenetic data (alex, trex, kronoviz), estimation of absolu [...]
 License: GPL (>= 2)
 URL: http://ape-package.ird.fr/
-Packaged: 2014-03-10 19:32:32 UTC; paradis
+Packaged: 2014-05-27 09:44:56 UTC; paradis
 Author: Emmanuel Paradis [aut, cre, cph],
   Ben Bolker [aut],
   Julien Claude [aut],
@@ -51,4 +51,4 @@ Author: Emmanuel Paradis [aut, cre, cph],
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis at ird.fr>
 NeedsCompilation: yes
 Repository: CRAN
-Date/Publication: 2014-03-11 08:49:37
+Date/Publication: 2014-05-27 12:44:48
diff --git a/MD5 b/MD5
index d0e1afe..3fc0633 100644
--- a/MD5
+++ b/MD5
@@ -1,20 +1,21 @@
-6eca4e9713ddea6c8b8f10a0a91ee38e *DESCRIPTION
+eb723b61539feef013de476e68b5c50a *COPYING
+0886cb4ddb9055dd86d406fd8d35c226 *DESCRIPTION
 1434ba4e31040404e8b049f75a705af5 *NAMESPACE
-8b12ae076e2ea8e6bf9b97f448e2ca65 *NEWS
+c12ba812ce8e6465319ef3c40499dee8 *NEWS
 0c7bc9101516fd26fb3ddbedbe25b6a3 *R/CADM.global.R
 e042efca1d8a00d4178204f5f481b64d *R/CADM.post.R
-08df4be0f8ac832938928f93d66437bb *R/CDF.birth.death.R
+5fd68920346c5aca7e7695fd9dbc1c3c *R/CDF.birth.death.R
 fdb9cfa0cbda82bda982b290693e44e3 *R/Cheverud.R
-5e7f355752302ea4822b62213ee3e3c0 *R/DNA.R
+f9400c37c74ed7d92838a27e19d8d12d *R/DNA.R
 0fbc7715dfdc8d54ded16d78ca3100f8 *R/MPR.R
 bb95af56d882b6162aa517a77140175e *R/MoranI.R
 dd2d159ad60c382ecc7331ddb10b3e5b *R/PGLS.R
 a683ed4e25ad199edc7d30e7b55181a6 *R/SDM.R
-0c8c5b7322f53936595f169f5fe1c65d *R/SlowinskiGuyer.R
-6f2c167948e151e900507bcacc30099e *R/ace.R
+6b54088bf2514e3aa70edf05fe88127d *R/SlowinskiGuyer.R
+a21847e7a8b02d88840e9464bb04fe3b *R/ace.R
 4ce79cf3f3ff49bef989454d86d0c891 *R/additive.R
 9fca35b1005cce7b2a260b553dd971a3 *R/alex.R
-bac63a18722805eea425aec102e9e71c *R/all.equal.phylo.R
+9fe874382f024a98f62a0ccfcd6d09ac *R/all.equal.phylo.R
 73f08934c47e0dfb29c49a9d0885cdb3 *R/as.bitsplits.R
 c94018d5e792c72e20ce84085b2df9e7 *R/as.matching.R
 7989b47a70f6003ac477370d92e9655e *R/as.phylo.R
@@ -27,7 +28,7 @@ a28930cdae07a271403e988e86a0c324 *R/biplot.pcoa.R
 e43b5dec7eae6d4bf9371e50117bf6ed *R/cherry.R
 02bdacc928572e8ab2d88380a075d7a8 *R/chronoMPL.R
 74e1019810b06458e808a447bb099a91 *R/chronopl.R
-f255979fbf13017c315569fc5e6ea8ca *R/chronos.R
+8ae1af4a30c40d15676d70e180f3d593 *R/chronos.R
 f6f25bb8f94f424dd6bbbab64eedb00d *R/clustal.R
 4f52fb37d822be586f0c5971295167dc *R/coalescent.intervals.R
 054bec70587f0056636b2cc52754c7f9 *R/collapse.singles.R
@@ -37,11 +38,11 @@ af76fbb797185c9738442161a2c923b4 *R/compar.gee.R
 207154a3a9b9ebbe5d7c29995565dc82 *R/compar.ou.R
 8d7c71929156744fd0e4fac370bf9456 *R/compute.brtime.R
 0092074917dc5631dc62fb9a3016145c *R/cophenetic.phylo.R
-d7db8dd1f147be51bcf4696c157d359a *R/cophyloplot.R
+13f2dac84d7b8a1da3df0e0c11b4ab1c *R/cophyloplot.R
 d5ae510a60a962ca6420366e3bc9cb1a *R/dbd.R
 93480a5b64e0d37f5450891629557615 *R/delta.plot.R
 dfd5bb35f1cb1fd9154d023e0e4cfc2b *R/dist.gene.R
-811adaf272b8fd6a96fccf432f203099 *R/dist.topo.R
+94a256e9220f68f0a8c72f029304055e *R/dist.topo.R
 b28ced504fedeb7f991f7eba10ad06df *R/diversi.gof.R
 8b2ec4004022afdc7e2cb42f2657b628 *R/diversi.time.R
 fd662cd4bbd6ce536ef379eca2e516ab *R/drop.tip.R
@@ -76,16 +77,16 @@ fc0260f9e8e17fc1446117580bbc93cc *R/pcoa.R
 4999c85e82105ded85a214204321c3d1 *R/phydataplot.R
 2730f72b8b261609ae8a57a7f0c0bb8b *R/phymltest.R
 61d1360195bf4d5e6e2d8c30de335dc8 *R/pic.R
-8078e89cfb035143409212a78b99d07f *R/plot.phylo.R
+57478ff610b5d0d3010c12ad17d968f8 *R/plot.phylo.R
 e579ec65c808c29e1ecaae1501784b37 *R/plot.popsize.R
 736506e2f67e90cf9326abead437d298 *R/plotPhyloCoor.R
 1e2485437566ca9af99d93b4580cbbc2 *R/print.lmorigin.R
 d0e8bd41d5acc217fdee3578adcf635b *R/print.parafit.R
 8c401518738b9cda403fa9f0eb382757 *R/rTrait.R
-ed6dc6a0298853c8a8eac2124f4ac288 *R/read.GenBank.R
+77eddff87cbbebdf5dc2c2fd81e74961 *R/read.GenBank.R
 b13dfb8f455b1c9e74a364085f72dbce *R/read.caic.R
 0b661f16611ef934c60f0a003734d471 *R/read.dna.R
-399d7ecded9a81f64710dc3d705d46bb *R/read.nexus.R
+fca9cd2c52414a936ab10a522136cf8a *R/read.nexus.R
 13ce7f5c7d1bcb7101469d12651e99c8 *R/read.nexus.data.R
 8aefdf68a66fc5ad148b4d5211a285ed *R/read.tree.R
 b1218f7862a66f566e4f3165f28fe47c *R/reorder.phylo.R
@@ -113,7 +114,7 @@ a918c086a449bcca5ccbb04f7e6d50a9 *R/yule.R
 c8d3aa3fe64e75e61af07a1b11c74f3f *R/yule.time.R
 1eb44ff9e5a036eb845faa1598ce5009 *R/zoom.R
 3387c0d0c1f913f8471e1bb34bd2e516 *R/zzz.R
-cd2b040e90078a8a28a00223b7d0d458 *build/vignette.rds
+a98e7f16070ea2c3d9334626fddd2024 *build/vignette.rds
 db9083e8750aff839d5ebf3ed982f1f1 *data/HP.links.rda
 9d9f9232839665422709ded1e541d038 *data/bird.families.rda
 a14a6df0f3a735ebc056065077788c90 *data/bird.orders.rda
@@ -121,21 +122,21 @@ f74f9ed80c04756021cc093d40ca9ff9 *data/carnivora.csv.gz
 4eaf8cbaefa2e8f8d395a9b482ee9967 *data/chiroptera.rda
 1c74c3b99d08b0e17eea3ec1065c12d2 *data/cynipids.rda
 7fe760c2f3b4deba0554aae6138cb602 *data/gopher.D.rda
-7dd0f4cf4d6c445e72ca417e044365a8 *data/hivtree.newick.rda
+c52ec1cde7c3f659aa4cb60a651a5e41 *data/hivtree.newick.rda
 8d14f95319d0a5cdc8faa60a1d0085ce *data/hivtree.table.txt.gz
-cb4d7535f04a45685284beeb3c39b18b *data/landplants.newick.rda
+d9d51e474a3483004b33196c436811e4 *data/landplants.newick.rda
 31be81fe3faca11f98d3e74c090bc59e *data/lice.D.rda
 38edbd84a0a067322c40db8d71fb1289 *data/lmorigin.ex1.rda
 e3ce9e3444182fea2e65df2e150ea0db *data/lmorigin.ex2.rda
 ce7a56faebdf286fdf5ba6c8c3699a79 *data/mat3.RData
 e2d1339025ed901009bfed58dc6505ff *data/mat5M3ID.RData
 101d0ab2e981b0987cde704a2dee1d8d *data/mat5Mrand.RData
-ea280638ed23f89ec89afc5464f368a5 *data/opsin.newick.rda
+7128cd7d6a1de5fabaa047ea73b038d2 *data/opsin.newick.rda
 39e4fece2bdc527d7a9d4d83d023a947 *data/woodmouse.rda
 828290996b613493f96e0fab024beebb *inst/CITATION
 3f54f3775bcf382e25df2a12228894f6 *inst/doc/MoranI.R
 abf2e3e84707634e32f3e7cc6a5ee7ae *inst/doc/MoranI.Rnw
-5980fdbb0b3f3e1f181f76072effaa88 *inst/doc/MoranI.pdf
+4dfb14a17dec4621f06dd5981acd5925 *inst/doc/MoranI.pdf
 e6876b193a0df06697c788a8e48cf4bc *man/CADM.global.Rd
 060222d269ef45f0c7df76bb723e7d45 *man/DNAbin.Rd
 8b9bc214e32cde4c6e5970e48ff30c5f *man/Initialize.corPhyl.Rd
@@ -143,7 +144,7 @@ e6876b193a0df06697c788a8e48cf4bc *man/CADM.global.Rd
 ff05fd6fa0a2750b53abf025cdc021d3 *man/MPR.Rd
 e63ecbd9a4cf6de364e595d5999e3a2e *man/MoranI.Rd
 17486c0fd29fb6f4a752c53fe37142c4 *man/SDM.Rd
-24cdb97990ec1fde5482e5abb5972569 *man/ace.Rd
+5027a986894645f46bade673bf835a3e *man/ace.Rd
 60adac0f324c7b08a756d8f45c02b024 *man/add.scale.bar.Rd
 32d8ad6eeea971901aee33f1f654ae7c *man/additive.Rd
 0f37535a86413945bf3205b7a7b7c20b *man/alex.Rd
@@ -250,7 +251,7 @@ c2e2f35f4e233265c86b7967ec2d0630 *man/parafit.Rd
 447941526b92322c52b5cfe367cb7088 *man/pic.Rd
 0363aa3fa3e86160934e2359c8ac5323 *man/pic.ortho.Rd
 265527313d479d3625df7680c7479cd1 *man/plot.correlogram.Rd
-e2440c324afa4a04836d72a93165839d *man/plot.phylo.Rd
+61a347b013548152104ed9786b3f499e *man/plot.phylo.Rd
 6bb1cf751772b9b6acf560b5f3c6f3c1 *man/plot.varcomp.Rd
 b24438c42cea969302ec6ba61002426e *man/print.phylo.Rd
 80bf68fd21b5e665329cf30b10a1655f *man/rTraitCont.Rd
@@ -305,7 +306,7 @@ d11fb19958f2953583a9c5876da82df9 *src/TBR.c
 d343190ba59ef1feac9c96752f210687 *src/ape.c
 7eaffd3d85df9a1e4460905e9ca5eced *src/ape.h
 19b564aab62c464c092cdf2f0d5cf447 *src/bNNI.c
-e9b547980b563db2f6b062bdcf7c4abe *src/bionjs.c
+79ca5c473decf13964192524caebf9f1 *src/bionjs.c
 f782a97466ed8008d31afd7a3e9d4ea9 *src/bipartition.c
 a5d4f692aca36f6b50e123b443792fa1 *src/bitsplits.c
 81e4ad60b418966cdd09e608e074bb28 *src/delta_plot.c
diff --git a/NEWS b/NEWS
index beb0b24..8a73e7b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,44 @@
+		CHANGES IN APE VERSION 3.1-2
+
+
+NEW FEATURES
+
+    o plot.phylo: the option 'open.angle' now works also when type =
+      "radial". The option 'lab4ut' now works also for type = "radial"
+      or "fan"; the default is now NULL since it will behave
+      differently depending on 'type'.
+
+    o ace(, type = "discrete") gains an option 'marginal' (FALSE by
+      default). The default is now to do a joint reconstruction of
+      ancestral states.
+
+
+BUG FIXES
+
+    o chronos: the gradients were not correctly computed when the age
+      of the root was unknown.
+
+    o prop.part() did not work with objects of class composite like
+      c("chronos", "phylo"). (Thanks to Steve Walker for the fix.)
+
+    o bionjs: a bug was fixed in the C code.
+
+    o read.GenBank() failed if a line starts with "ORIGIN" in the
+      description of the sequence (thanks to Sofia Sal Bregua for the
+      fix).
+
+    o cophyloplot() works better with length.line = 0.
+
+    o The internal function clado.build used to return trees with the
+      'edge' matrix stored as double instead of integer.
+
+
+OTHER CHANGES
+
+    o base.freq() now checks the class of the data.
+
+
+
 		CHANGES IN APE VERSION 3.1-1
 
 
@@ -6,6 +47,11 @@ BUG FIXES
     o rTraitCont: a bug was introduced in the previous release.
 
 
+OTHER CHANGES
+
+    o ape now requires R 3.0.0 or higher.
+
+
 
 		CHANGES IN APE VERSION 3.1
 
diff --git a/R/CDF.birth.death.R b/R/CDF.birth.death.R
index 35b9028..8dadfdb 100644
--- a/R/CDF.birth.death.R
+++ b/R/CDF.birth.death.R
@@ -243,7 +243,7 @@ rlineage <-
         if (Foo(t, Tmax) < P) return(Tmax + 1)
         inc <- 10
         x <- t + inc
-        while (inc > eps) { # la pr�cision influe sur le temps de calcul
+        while (inc > eps) { # la precision influe sur le temps de calcul
             if (Foo(t, x) > P) {
                 x <- x - inc
                 inc <- inc/10
@@ -331,7 +331,7 @@ rbdtree <-
         if (Foo(t, Tmax) < P) return(Tmax + 1)
         inc <- 10
         x <- t + inc
-        while (inc > eps) { # la pr�cision influe sur le temps de calcul
+        while (inc > eps) { # la precision influe sur le temps de calcul
             if (Foo(t, x) > P) {
                 x <- x - inc
                 inc <- inc/10
diff --git a/R/DNA.R b/R/DNA.R
index de0c300..6a06778 100644
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,8 +1,8 @@
-## DNA.R (2013-08-12)
+## DNA.R (2014-03-12)
 
 ##   Manipulations and Comparisons of DNA Sequences
 
-## Copyright 2002-2013 Emmanuel Paradis
+## Copyright 2002-2014 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -284,6 +284,8 @@ as.character.DNAbin <- function(x, ...)
 
 base.freq <- function(x, freq = FALSE, all = FALSE)
 {
+    if (!inherits(x, "DNAbin")) stop('base.freq requires an object of class "DNAbin"')
+
     f <- function(x)
         .C(BaseProportion, x, as.integer(length(x)), double(17),
            NAOK = TRUE)[[3]]
diff --git a/R/SlowinskiGuyer.R b/R/SlowinskiGuyer.R
index b0fc956..353c467 100644
--- a/R/SlowinskiGuyer.R
+++ b/R/SlowinskiGuyer.R
@@ -42,7 +42,6 @@ richness.yule.test <- function(x, t)
     n <- c(n1, n2)
     tb <- c(t, t)
 
-    ## taken from /home/paradis/data/Projets/FISHLOSS/BDfit.R:
     .PrNt.Yule <- function(N, age, birth) {
         tmp <- exp(-birth * age)
         tmp * (1 - tmp)^(N - 1)
diff --git a/R/ace.R b/R/ace.R
index e2b8c8f..7b5cd73 100644
--- a/R/ace.R
+++ b/R/ace.R
@@ -1,8 +1,8 @@
-## ace.R (2013-08-14)
+## ace.R (2014-05-27)
 
 ##   Ancestral Character Estimation
 
-## Copyright 2005-2013 Emmanuel Paradis and Ben Bolker
+## Copyright 2005-2014 Emmanuel Paradis and Ben Bolker
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -24,7 +24,7 @@ ace <-
            method = if (type == "continuous") "REML" else "ML",
            CI = TRUE, model = if (type == "continuous") "BM" else "ER",
            scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1,
-           use.expm = FALSE, use.eigen = TRUE)
+           use.expm = FALSE, use.eigen = TRUE, marginal = FALSE)
 {
     if (!inherits(phy, "phylo"))
         stop('object "phy" is not of class "phylo"')
@@ -178,9 +178,9 @@ ace <-
                    })
         } else {
             if (ncol(model) != nrow(model))
-              stop("the matrix given as 'model' is not square")
+                stop("the matrix given as 'model' is not square")
             if (ncol(model) != nl)
-              stop("the matrix 'model' must have as many rows as the number of categories in 'x'")
+                stop("the matrix 'model' must have as many rows as the number of categories in 'x'")
             rate <- model
             np <- max(rate)
         }
@@ -233,11 +233,10 @@ ace <-
             } else matexpo
             dev <- function(p, output.liks = FALSE) {
                 if (any(is.nan(p)) || any(is.infinite(p))) return(1e50)
-                ## from Rich FitzJohn:
-                comp <- numeric(nb.tip + nb.node) # Storage...
+                comp <- numeric(nb.tip + nb.node) # from Rich FitzJohn
                 Q[] <- c(p, 0)[rate]
                 diag(Q) <- -rowSums(Q)
-                for (i  in seq(from = 1, by = 2, length.out = nb.node)) {
+                for (i in seq(from = 1, by = 2, length.out = nb.node)) {
                     j <- i + 1L
                     anc <- e1[i]
                     des1 <- e2[i]
@@ -263,14 +262,36 @@ ace <-
         out.nlm <- try(nlm(function(p) dev(p), p = obj$rates, iterlim = 1,
                            stepmax = 0, hessian = TRUE), silent = TRUE)
         options(oldwarn)
-        obj$se <-  if (class(out.nlm) == "try-error") {
+        obj$se <- if (class(out.nlm) == "try-error") {
             warning("model fit suspicious: gradients apparently non-finite")
             rep(NaN, np)
         } else .getSEs(out.nlm)
         obj$index.matrix <- index.matrix
         if (CI) {
-            obj$lik.anc <- dev(obj$rates, TRUE)
-            colnames(obj$lik.anc) <- lvls
+            lik.anc <- dev(obj$rates, TRUE)
+            if (!marginal) {
+                Q[] <- c(obj$rates, 0)[rate]
+                diag(Q) <- -rowSums(Q)
+                for (i in seq(to = 1, by = -2, length.out = nb.node)) {
+                    anc <- e1[i] - nb.tip
+                    des1 <- e2[i] - nb.tip
+                    if (des1 > 0) {
+                        P <- matexpo(Q * EL[i])
+                        tmp <- lik.anc[anc, ] / (lik.anc[des1, ] %*% P)
+                        lik.anc[des1, ] <- (tmp %*% P) * lik.anc[des1, ]
+                    }
+                    j <- i + 1L
+                    des2 <- e2[j] - nb.tip
+                    if (des2 > 0) {
+                        P <- matexpo(Q * EL[j])
+                        tmp <- lik.anc[anc, ] / (lik.anc[des2, ] %*% P)
+                        lik.anc[des2, ] <- (tmp %*% P) * lik.anc[des2, ]
+                    }
+                    lik.anc <- lik.anc / rowSums(lik.anc)
+                }
+            }
+            colnames(lik.anc) <- lvls
+            obj$lik.anc <- lik.anc
         }
     }
     obj$call <- match.call()
@@ -278,6 +299,7 @@ ace <-
     obj
 }
 
+
 logLik.ace <- function(object, ...) object$loglik
 
 deviance.ace <- function(object, ...) -2*object$loglik
diff --git a/R/all.equal.phylo.R b/R/all.equal.phylo.R
index 79533d5..3833075 100644
--- a/R/all.equal.phylo.R
+++ b/R/all.equal.phylo.R
@@ -2,23 +2,23 @@
 ##
 ##     Global Comparison of two Phylogenies
 
-## Copyright 2006 Beno�t Durand
+## Copyright 2006 Benoit Durand
 ##    modified by EP for the new coding of "phylo" (2006-10-04)
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
 
 ## Recherche de la correspondance entre deux arbres
-## Parcours en profondeur et en parall�le des deux arbres (current et target)
-## current, target: les deux arbres � comparer
+## Parcours en profondeur et en parallele des deux arbres (current et target)
+## current, target: les deux arbres a comparer
 ## use.edge.length: faut-il comparer les longueurs de branches ?
-## use.tip.label: faut-il comparer les �tiquettes de feuilles ou seulement la
+## use.tip.label: faut-il comparer les etiquettes de feuilles ou seulement la
 ##	topologie des deux arbres ?
 ## index.return: si TRUE, retourner la matrice de correspondance entre noeuds
-##	et feuilles, une matrice � deux colonnes (current et target) avec pour
+##	et feuilles, une matrice a deux colonnes (current et target) avec pour
 ##	chaque ligne des paires d'identifiants de noeuds/feuilles, tels qu'ils
 ##	apparaissent dans l'attribut 'edge' des objets phylo
-## tolerance, scale: param�tres de comparaison des longueurs de branches
+## tolerance, scale: parametres de comparaison des longueurs de branches
 ##	(voir 'all.equal')
 all.equal.phylo <- function(target, current,
                         use.edge.length = TRUE,
diff --git a/R/chronos.R b/R/chronos.R
index 115cd19..a7f63a9 100644
--- a/R/chronos.R
+++ b/R/chronos.R
@@ -1,8 +1,8 @@
-## chronos.R (2013-01-03)
+## chronos.R (2014-05-15)
 
 ##   Molecular Dating With Penalized and Maximum Likelihood
 
-## Copyright 2013 Emmanuel Paradis
+## Copyright 2013-2014 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -244,14 +244,15 @@ maybe you need to adjust the calibration dates")
     gradient.poisson <- function(rate, node.time) {
         age[unknown.ages] <- node.time
         real.edge.length <- age[e1] - age[e2]
-        #if (any(real.edge.length < 0))
-        #    return(numeric(N + length(unknown.ages)))
+
         ## gradient for the rates:
         gr <- el/rate - real.edge.length
 
         ## gradient for the dates:
         tmp <- el/real.edge.length - rate
-        gr.dates <- sapply(A_ki, function(x) sum(tmp[x])) - tmp[D_ki]
+        tmp2 <- tmp[D_ki]
+        tmp2[is.na(tmp2)] <- 0
+        gr.dates <- sapply(A_ki, function(x) sum(tmp[x])) - tmp2
 
         c(gr, gr.dates)
     }
diff --git a/R/cophyloplot.R b/R/cophyloplot.R
index 29e5b3c..56d4b1d 100644
--- a/R/cophyloplot.R
+++ b/R/cophyloplot.R
@@ -1,4 +1,4 @@
-## cophyloplot.R (2012-02-14)
+## cophyloplot.R (2014-04-07)
 
 ##   Plots two phylogenetic trees face to
 ##   face with the links between the tips
@@ -34,7 +34,7 @@ cophyloplot <-
                   y <- rotate(y, click - length(res$a[, 1]))
             }
         }
-        on.exit(print("done"))
+        on.exit(cat("done\n"))
     }
     else plotCophylo2(x, y, assoc = assoc, use.edge.length = use.edge.length,
         space = space, length.line = length.line, gap = gap,
@@ -152,17 +152,19 @@ plotCophylo2 <-
             decx[i] <- decy[i] <- 0
         }
 
-        segments(a[lsa[x$tip.label == assoc[i, 1]], 1] + decx[i] + gap,
-                 a[lsa[x$tip.label == assoc[i, 1]], 2],
-                 a[lsa[x$tip.label == assoc[i, 1]], 1] + gap + left,
-                 a[lsa[x$tip.label ==  assoc[i, 1]], 2],
-                 col = colors[i], lwd = lwidths[i], lty = ltype[i])
+        if (length.line) { # added by EP (2014-04-07)
+            segments(a[lsa[x$tip.label == assoc[i, 1]], 1] + decx[i] + gap,
+                     a[lsa[x$tip.label == assoc[i, 1]], 2],
+                     a[lsa[x$tip.label == assoc[i, 1]], 1] + gap + left,
+                     a[lsa[x$tip.label ==  assoc[i, 1]], 2],
+                     col = colors[i], lwd = lwidths[i], lty = ltype[i])
 
-        segments(b2[lsb[y$tip.label == assoc[i, 2]], 1] - (decy[i] + gap),
-                 b2[lsb[y$tip.label == assoc[i, 2]], 2],
-                 b2[lsb[y$tip.label == assoc[i, 2]], 1] - (gap + right),
-                 b2[lsb[y$tip.label ==  assoc[i, 2]], 2],
-                 col = colors[i], lwd = lwidths[i], lty = ltype[i])
+            segments(b2[lsb[y$tip.label == assoc[i, 2]], 1] - (decy[i] + gap),
+                     b2[lsb[y$tip.label == assoc[i, 2]], 2],
+                     b2[lsb[y$tip.label == assoc[i, 2]], 1] - (gap + right),
+                     b2[lsb[y$tip.label ==  assoc[i, 2]], 2],
+                     col = colors[i], lwd = lwidths[i], lty = ltype[i])
+        }
 
         segments(a[lsa[x$tip.label == assoc[i, 1]], 1] + gap + left,
                  a[lsa[x$tip.label == assoc[i, 1]], 2],
diff --git a/R/dist.topo.R b/R/dist.topo.R
index ce49a81..d2907df 100644
--- a/R/dist.topo.R
+++ b/R/dist.topo.R
@@ -1,4 +1,4 @@
-## dist.topo.R (2014-03-07)
+## dist.topo.R (2014-05-16)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
@@ -97,7 +97,7 @@ dist.topo <- function(x, y, method = "PH85")
 prop.part <- function(..., check.labels = TRUE)
 {
     obj <- list(...)
-    if (length(obj) == 1 && class(obj[[1]]) != "phylo")
+    if (length(obj) == 1 && !inherits(obj[[1]], "phylo")) # fix by Steve Walker (2014-03-31)
         obj <- obj[[1]]
     ntree <- length(obj)
     if (ntree == 1) check.labels <- FALSE
diff --git a/R/plot.phylo.R b/R/plot.phylo.R
index 8950bed..3106dc6 100644
--- a/R/plot.phylo.R
+++ b/R/plot.phylo.R
@@ -1,4 +1,4 @@
-## plot.phylo.R (2014-03-03)
+## plot.phylo.R (2014-05-07)
 
 ##   Plot Phylogenies
 
@@ -14,7 +14,7 @@ plot.phylo <-
              edge.width = 1, edge.lty = 1, font = 3, cex = par("cex"),
              adj = NULL, srt = 0, no.margin = FALSE, root.edge = FALSE,
              label.offset = 0, underscore = FALSE, x.lim = NULL,
-             y.lim = NULL, direction = "rightwards", lab4ut = "horizontal",
+             y.lim = NULL, direction = "rightwards", lab4ut = NULL,
              tip.color = "black", plot = TRUE, rotate.tree = 0,
              open.angle = 0, node.depth = 1, ...)
 {
@@ -97,11 +97,11 @@ plot.phylo <-
     ## 'z' is the tree in postorder order used in calls to .C
     z <- reorder(x, order = "postorder")
 
-    if (phyloORclado) {
-        if (is.null(node.pos)) {
-            node.pos <- 1
-            if (type == "cladogram" && !use.edge.length) node.pos <- 2
-        }
+if (phyloORclado) {
+        if (is.null(node.pos))
+            node.pos <-
+                if (type == "cladogram" && !use.edge.length) 2 else 1
+
         if (node.pos == 1)
             yy <- .nodeHeight(Ntip, Nnode, z$edge, Nedge, yy)
         else {
@@ -120,10 +120,11 @@ plot.phylo <-
         } else  {
             xx <- .nodeDepthEdgelength(Ntip, Nnode, z$edge, Nedge, z$edge.length)
         }
-    } else {
+} else {
     twopi <- 2 * pi
     rotate.tree <- twopi * rotate.tree/360
-    switch(type, "fan" = {
+
+    if (type != "unrooted") { # for "fan" and "radial" trees (open.angle)
         ## if the tips are not in the same order in tip.label
         ## and in edge[, 2], we must reorder the angles: we
         ## use `xx' to store temporarily the angles
@@ -133,6 +134,9 @@ plot.phylo <-
         theta <- double(Ntip)
         theta[TIPS] <- xx
         theta <- c(theta, numeric(Nnode))
+    }
+
+    switch(type, "fan" = {
         theta <- .nodeHeight(Ntip, Nnode, z$edge, Nedge, theta)
         if (use.edge.length) {
             r <- .nodeDepthEdgelength(Ntip, Nnode, z$edge, Nedge, z$edge.length)
@@ -153,16 +157,15 @@ plot.phylo <-
         xx <- XY$M[, 1] - min(XY$M[, 1])
         yy <- XY$M[, 2] - min(XY$M[, 2])
     }, "radial" = {
-        X <- .nodeDepth(Ntip, Nnode, z$edge, Nedge, node.depth)
-        X[X == 1] <- 0
-        ## radius:
-        X <- 1 - X/Ntip
-        ## angle (1st compute the angles for the tips):
-        yy <- c((1:Ntip)*twopi/Ntip, rep(0, Nnode))
-        Y <- .nodeHeight(Ntip, Nnode, z$edge, Nedge, yy)
-        xx <- X * cos(Y + rotate.tree)
-        yy <- X * sin(Y + rotate.tree)
-    })}
+        r <- .nodeDepth(Ntip, Nnode, z$edge, Nedge, node.depth)
+        r[r == 1] <- 0
+        r <- 1 - r/Ntip
+        theta <- .nodeHeight(Ntip, Nnode, z$edge, Nedge, theta) + rotate.tree
+        xx <- r * cos(theta)
+        yy <- r * sin(theta)
+    })
+}
+
     if (phyloORclado) {
         if (!horizontal) {
             tmp <- yy
@@ -174,13 +177,18 @@ plot.phylo <-
             if (direction == "upwards") yy <- yy + x$root.edge
         }
     }
+
     if (no.margin) par(mai = rep(0, 4))
+
+    if (show.tip.label) nchar.tip.label <- nchar(x$tip.label)
+    max.yy <- max(yy)
+
     if (is.null(x.lim)) {
         if (phyloORclado) {
             if (horizontal) {
                 x.lim <- c(0, NA)
                 pin1 <- par("pin")[1] # width of the device in inches
-                strWi <- strwidth(x$tip.label, "inches") # id. for the tip labels
+                strWi <- strwidth(x$tip.label, "inches", cex = cex) # id. for the tip labels
                 ## 1.04 comes from that we are using a regular axis system
                 ## with 4% on both sides of the range of x:
                 xx.tips <- xx[1:Ntip] * 1.04
@@ -188,25 +196,26 @@ plot.phylo <-
                 ## user coordinates to inches:
                 alp <- try(uniroot(function(a) max(a*xx.tips + strWi) - pin1,
                                    c(0, 1e6))$root, silent = TRUE)
-                ## if the above fails, give 1/3 of the device for the tip labels:
+                ## if the above fails, give 1/3 of the plot for the tip labels:
                 if (is.character(alp)) tmp <- max(xx.tips)*1.5 else {
                     tmp <- if (show.tip.label) max(xx.tips + strWi/alp) else max(xx.tips)
                 }
+                if (show.tip.label) tmp <- tmp + label.offset
                 x.lim[2] <- tmp
             } else x.lim <- c(1, Ntip)
         } else switch(type, "fan" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
-                x.lim <- c(min(xx) - offset, max(xx) + offset)
-            } else x.lim <- c(min(xx), max(xx))
+                offset <- max(nchar.tip.label * 0.018 * max.yy * cex)
+                x.lim <- range(xx) + c(-offset, offset)
+            } else x.lim <- range(xx)
         }, "unrooted" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
+                offset <- max(nchar.tip.label * 0.018 * max.yy * cex)
                 x.lim <- c(0 - offset, max(xx) + offset)
             } else x.lim <- c(0, max(xx))
         }, "radial" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.03 * cex)
+                offset <- max(nchar.tip.label * 0.03 * cex)
                 x.lim <- c(-1 - offset, 1 + offset)
             } else x.lim <- c(-1, 1)
         })
@@ -214,10 +223,10 @@ plot.phylo <-
         x.lim <- c(0, x.lim)
         if (phyloORclado && !horizontal) x.lim[1] <- 1
         if (type %in% c("fan", "unrooted") && show.tip.label)
-          x.lim[1] <- -max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
+          x.lim[1] <- -max(nchar.tip.label * 0.018 * max.yy * cex)
         if (type == "radial")
           x.lim[1] <-
-            if (show.tip.label) -1 - max(nchar(x$tip.label) * 0.03 * cex)
+            if (show.tip.label) -1 - max(nchar.tip.label * 0.03 * cex)
             else -1
     }
     ## mirror the xx:
@@ -227,7 +236,7 @@ plot.phylo <-
             if (horizontal) y.lim <- c(1, Ntip) else {
                 y.lim <- c(0, NA)
                 pin2 <- par("pin")[2] # height of the device in inches
-                strWi <- strwidth(x$tip.label, "inches")
+                strWi <- strwidth(x$tip.label, "inches", cex = cex)
                 ## 1.04 comes from that we are using a regular axis system
                 ## with 4% on both sides of the range of x:
                 yy.tips <- yy[1:Ntip] * 1.04
@@ -239,21 +248,22 @@ plot.phylo <-
                 if (is.character(alp)) tmp <- max(yy.tips)*1.5 else {
                     tmp <- if (show.tip.label) max(yy.tips + strWi/alp) else max(yy.tips)
                 }
+                if (show.tip.label) tmp <- tmp + label.offset
                 y.lim[2] <- tmp
             }
         } else switch(type, "fan" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
-                y.lim <- c(min(yy) - offset, max(yy) + offset)
-            } else y.lim <- c(min(yy), max(yy))
+                offset <- max(nchar.tip.label * 0.018 * max.yy * cex)
+                y.lim <- c(min(yy) - offset, max.yy + offset)
+            } else y.lim <- c(min(yy), max.yy)
         }, "unrooted" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
-                y.lim <- c(0 - offset, max(yy) + offset)
-            } else y.lim <- c(0, max(yy))
+                offset <- max(nchar.tip.label * 0.018 * max.yy * cex)
+                y.lim <- c(0 - offset, max.yy + offset)
+            } else y.lim <- c(0, max.yy)
         }, "radial" = {
             if (show.tip.label) {
-                offset <- max(nchar(x$tip.label) * 0.03 * cex)
+                offset <- max(nchar.tip.label * 0.03 * cex)
                 y.lim <- c(-1 - offset, 1 + offset)
             } else y.lim <- c(-1, 1)
         })
@@ -261,9 +271,9 @@ plot.phylo <-
         y.lim <- c(0, y.lim)
         if (phyloORclado && horizontal) y.lim[1] <- 1
         if (type %in% c("fan", "unrooted") && show.tip.label)
-            y.lim[1] <- -max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
+            y.lim[1] <- -max(nchar.tip.label * 0.018 * max.yy * cex)
         if (type == "radial")
-            y.lim[1] <- if (show.tip.label) -1 - max(nchar(x$tip.label) * 0.018 * max(yy) * cex) else -1
+            y.lim[1] <- if (show.tip.label) -1 - max(nchar.tip.label * 0.018 * max.yy * cex) else -1
     }
     ## mirror the yy:
     if (phyloORclado && direction == "downwards") yy <- y.lim[2] - yy # fix by Klaus
@@ -337,31 +347,71 @@ if (plot) {
         if (phyloORclado)
             text(xx[1:Ntip] + lox, yy[1:Ntip] + loy, x$tip.label, adj = adj,
                  font = font, srt = srt, cex = cex, col = tip.color)
+        else {
+            angle <- if (type == "unrooted") XY$axe else atan2(yy[1:Ntip], xx[1:Ntip]) # in radians
+
+            lab4ut <-
+                if (is.null(lab4ut)) {
+                    if (type == "unrooted") "horizontal" else "axial"
+                } else match.arg(lab4ut, c("horizontal", "axial"))
 
-        if (type == "unrooted") {
             if (lab4ut == "horizontal") {
                 y.adj <- x.adj <- numeric(Ntip)
-                sel <- abs(XY$axe) > 0.75 * pi
+                sel <- abs(angle) > 0.75 * pi
                 x.adj[sel] <- -strwidth(x$tip.label)[sel] * 1.05
-                sel <- abs(XY$axe) > pi/4 & abs(XY$axe) < 0.75 * pi
-                x.adj[sel] <- -strwidth(x$tip.label)[sel] * (2 * abs(XY$axe)[sel] / pi - 0.5)
-                sel <- XY$axe > pi / 4 & XY$axe < 0.75 * pi
+                sel <- abs(angle) > pi/4 & abs(angle) < 0.75 * pi
+                x.adj[sel] <- -strwidth(x$tip.label)[sel] * (2 * abs(angle)[sel] / pi - 0.5)
+                sel <- angle > pi / 4 & angle < 0.75 * pi
                 y.adj[sel] <- strheight(x$tip.label)[sel] / 2
-                sel <- XY$axe < -pi / 4 & XY$axe > -0.75 * pi
+                sel <- angle < -pi / 4 & angle > -0.75 * pi
                 y.adj[sel] <- -strheight(x$tip.label)[sel] * 0.75
                 text(xx[1:Ntip] + x.adj * cex, yy[1:Ntip] + y.adj * cex,
                      x$tip.label, adj = c(adj, 0), font = font,
                      srt = srt, cex = cex, col = tip.color)
             } else { # if lab4ut == "axial"
-                adj <- abs(XY$axe) > pi/2
-                srt <- 180 * XY$axe / pi
-                srt[adj] <- srt[adj] - 180
-                adj <- as.numeric(adj)
+###                adj <- abs(XY$axe) > pi/2
+###                srt <- 180 * XY$axe / pi
+###                srt[adj] <- srt[adj] - 180
+###                adj <- as.numeric(adj)
+###                xx.tips <- xx[1:Ntip]
+###                yy.tips <- yy[1:Ntip]
+###                if (label.offset) {
+###                    xx.tips <- xx.tips + label.offset * cos(XY$axe)
+###                    yy.tips <- yy.tips + label.offset * sin(XY$axe)
+###                }
+###                ## `srt' takes only a single value, so can't vectorize this:
+###                ## (and need to 'elongate' these vectors:)
+###                font <- rep(font, length.out = Ntip)
+###                tip.color <- rep(tip.color, length.out = Ntip)
+###                cex <- rep(cex, length.out = Ntip)
+###                for (i in 1:Ntip)
+###                    text(xx.tips[i], yy.tips[i], cex = cex[i],
+###                         x$tip.label[i], adj = adj[i], font = font[i],
+###                         srt = srt[i], col = tip.color[i])
+###            }
+###        }
+###        if (type %in% c("fan", "radial")) {
                 xx.tips <- xx[1:Ntip]
                 yy.tips <- yy[1:Ntip]
+###            angle <- atan2(yy.tips, xx.tips) # in radians
                 if (label.offset) {
-                    xx.tips <- xx.tips + label.offset * cos(XY$axe)
-                    yy.tips <- yy.tips + label.offset * sin(XY$axe)
+                    xx.tips <- xx.tips + label.offset * cos(angle)
+                    yy.tips <- yy.tips + label.offset * sin(angle)
+                }
+###            s <- xx.tips < 0
+###            angle <- angle * 180/pi # switch to degrees
+###            angle[s] <- angle[s] + 180
+###            adj <- as.numeric(s)
+                if (type == "unrooted"){
+                    adj <- abs(angle) > pi/2
+                    angle <- angle * 180/pi # switch to degrees
+                    angle[adj] <- angle[adj] - 180
+                    adj <- as.numeric(adj)
+                } else {
+                    s <- xx.tips < 0
+                    angle <- angle * 180/pi
+                    angle[s] <- angle[s] + 180
+                    adj <- as.numeric(s)
                 }
                 ## `srt' takes only a single value, so can't vectorize this:
                 ## (and need to 'elongate' these vectors:)
@@ -369,32 +419,10 @@ if (plot) {
                 tip.color <- rep(tip.color, length.out = Ntip)
                 cex <- rep(cex, length.out = Ntip)
                 for (i in 1:Ntip)
-                    text(xx.tips[i], yy.tips[i], cex = cex[i],
-                         x$tip.label[i], adj = adj[i], font = font[i],
-                         srt = srt[i], col = tip.color[i])
-            }
-        }
-        if (type %in% c("fan", "radial")) {
-            xx.tips <- xx[1:Ntip]
-            yy.tips <- yy[1:Ntip]
-            angle <- atan2(yy.tips, xx.tips) # in radians
-            if (label.offset) {
-                xx.tips <- xx.tips + label.offset * cos(angle)
-                yy.tips <- yy.tips + label.offset * sin(angle)
+                    text(xx.tips[i], yy.tips[i], x$tip.label[i], font = font[i],
+                         cex = cex[i], srt = angle[i], adj = adj[i],
+                         col = tip.color[i])
             }
-            s <- xx.tips < 0
-            angle <- angle * 180/pi # switch to degrees
-            angle[s] <- angle[s] + 180
-            adj <- as.numeric(s)
-            ## `srt' takes only a single value, so can't vectorize this:
-            ## (and need to 'elongate' these vectors:)
-            font <- rep(font, length.out = Ntip)
-            tip.color <- rep(tip.color, length.out = Ntip)
-            cex <- rep(cex, length.out = Ntip)
-            for (i in 1:Ntip)
-                text(xx.tips[i], yy.tips[i], x$tip.label[i], font = font[i],
-                     cex = cex[i], srt = angle[i], adj = adj[i],
-                     col = tip.color[i])
         }
     }
     if (show.node.label)
@@ -426,14 +454,20 @@ phylogram.plot <- function(edge, Ntip, Nnode, xx, yy, horizontal,
     ## un trait vertical a chaque noeud...
     x0v <- xx[nodes]
     y0v <- y1v <- numeric(Nnode)
+
     ## store the index of each node in the 1st column of edge:
     NodeInEdge1 <- vector("list", Nnode)
-    for (i in nodes) {
-        ii <- i - Ntip
-        j <- NodeInEdge1[[ii]] <- which(edge[, 1] == i)
+    e1 <- edge[, 1]
+    for (i in seq_along(e1)) {
+        j <- e1[i] - Ntip
+        NodeInEdge1[[j]] <- c(NodeInEdge1[[j]], i)
+    }
+
+    for (i in 1:Nnode) {
+        j <- NodeInEdge1[[i]]
         tmp <- range(yy[edge[j, 2]])
-        y0v[ii] <- tmp[1]
-        y1v[ii] <- tmp[2]
+        y0v[i] <- tmp[1]
+        y1v[i] <- tmp[2]
     }
     ## ... et un trait horizontal partant de chaque tip et chaque noeud
     ##  vers la racine
diff --git a/R/read.GenBank.R b/R/read.GenBank.R
index 23bf4db..d490215 100644
--- a/R/read.GenBank.R
+++ b/R/read.GenBank.R
@@ -1,8 +1,8 @@
-## read.GenBank.R (2012-02-17)
+## read.GenBank.R (2014-04-02)
 
 ##   Read DNA Sequences from GenBank via Internet
 
-## Copyright 2002-2012 Emmanuel Paradis
+## Copyright 2002-2014 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -25,7 +25,7 @@ read.GenBank <-
                      "&rettype=gb&retmode=text", sep = "")
         X <- c(X, scan(file = URL, what = "", sep = "\n", quiet = TRUE))
     }
-    FI <- grep("^ {0,}ORIGIN", X) + 1
+    FI <- which(X == "ORIGIN      ") + 1 # fix by Sofia Sal Bregua (2014-04-02)
     LA <- which(X == "//") - 1
     obj <- vector("list", N)
     for (i in 1:N) {
diff --git a/R/read.nexus.R b/R/read.nexus.R
index ac567c2..a3b7d4d 100644
--- a/R/read.nexus.R
+++ b/R/read.nexus.R
@@ -1,8 +1,8 @@
-## read.nexus.R (2012-09-28)
+## read.nexus.R (2014-04-09)
 
 ##   Read Tree File in Nexus Format
 
-## Copyright 2003-2012 Emmanuel Paradis and 2010 Klaus Schliep
+## Copyright 2003-2014 Emmanuel Paradis and 2010 Klaus Schliep
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -23,29 +23,29 @@
 clado.build <- function(tp)
 {
     add.internal <- function() {
-        edge[j, 1] <<- current.node
-        node <<- node + 1
-        edge[j, 2] <<- current.node <<- node
+        edge[j, 1L] <<- current.node
+        node <<- node + 1L
+        edge[j, 2L] <<- current.node <<- node
         index[node] <<- j # set index
-        j <<- j + 1
+        j <<- j + 1L
     }
     add.terminal <- function() {
-        edge[j, 1] <<- current.node
-        edge[j, 2] <<- tip
+        edge[j, 1L] <<- current.node
+        edge[j, 2L] <<- tip
         index[tip] <<- j # set index
         tip.label[tip] <<- tpc[k]
-        k <<- k + 1
-        tip <<- tip + 1
-        j <<- j + 1
+        k <<- k + 1L
+        tip <<- tip + 1L
+        j <<- j + 1L
     }
     go.down <- function() {
         l <- index[current.node]
         node.label[current.node - nb.tip] <<- tpc[k]
-        k <<- k + 1
-        current.node <<- edge[l, 1]
+        k <<- k + 1L
+        current.node <<- edge[l, 1L]
     }
     if (!length(grep(",", tp))) {
-        obj <- list(edge = matrix(c(2, 1), 1, 2), Nnode = 1)
+        obj <- list(edge = matrix(c(2L, 1L), 1L, 2L), Nnode = 1L)
         tp <- unlist(strsplit(tp, "[\\(\\);]"))
         obj$tip.label <- tp[2]
         if (tp[3] != "") obj$node.label <- tp[3]
@@ -60,24 +60,24 @@ clado.build <- function(tp)
     skeleton <- tsp[tsp == "(" | tsp == ")" | tsp == "," | tsp == ";"]
     nsk <- length(skeleton)
     nb.node <- length(skeleton[skeleton == ")"])
-    nb.tip <- length(skeleton[skeleton == ","]) + 1
+    nb.tip <- length(skeleton[skeleton == ","]) + 1L
     ## We will assume there is an edge at the root;
     ## if so, it will be removed and put in a vector
     nb.edge <- nb.node + nb.tip
     node.label <- character(nb.node)
     tip.label <- character(nb.tip)
 
-    edge <- matrix(NA, nb.edge, 2)
-    current.node <- node <- nb.tip + 1 # node number
-    edge[nb.edge, 1] <- 0    # see comment above
-    edge[nb.edge, 2] <- node #
+    edge <- matrix(NA_integer_, nb.edge, 2L)
+    current.node <- node <- nb.tip + 1L # node number
+    edge[nb.edge, 1L] <- 0L   # see comment above
+    edge[nb.edge, 2L] <- node #
 
-    index <- numeric(nb.edge + 1)
+    index <- numeric(nb.edge + 1L)
     index[node] <- nb.edge
     ## j: index of the line number of edge
     ## k: index of the line number of tpc
     ## tip: tip number
-    j <- k <- tip <- 1
+    j <- k <- tip <- 1L
     for (i in 2:nsk) {
         if (skeleton[i] == "(") add.internal()      # add an internal branch (on top)
         if (skeleton[i] == ",") {
diff --git a/build/vignette.rds b/build/vignette.rds
index 4ce6254..9aeb3b1 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/data/hivtree.newick.rda b/data/hivtree.newick.rda
index 94b996f..36d30f0 100644
Binary files a/data/hivtree.newick.rda and b/data/hivtree.newick.rda differ
diff --git a/data/landplants.newick.rda b/data/landplants.newick.rda
index 2ad392d..ff9b2af 100644
Binary files a/data/landplants.newick.rda and b/data/landplants.newick.rda differ
diff --git a/data/opsin.newick.rda b/data/opsin.newick.rda
index 2561a99..42c5688 100644
Binary files a/data/opsin.newick.rda and b/data/opsin.newick.rda differ
diff --git a/inst/doc/MoranI.pdf b/inst/doc/MoranI.pdf
index 75ecbf2..2d44754 100644
Binary files a/inst/doc/MoranI.pdf and b/inst/doc/MoranI.pdf differ
diff --git a/man/ace.Rd b/man/ace.Rd
index 1461ff0..c61b7f6 100644
--- a/man/ace.Rd
+++ b/man/ace.Rd
@@ -27,7 +27,7 @@ ace(x, phy, type = "continuous", method = if (type == "continuous")
    "REML" else "ML", CI = TRUE,
     model = if (type == "continuous") "BM" else "ER",
     scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1,
-    use.expm = FALSE, use.eigen = TRUE)
+    use.expm = FALSE, use.eigen = TRUE, marginal = FALSE)
 \method{print}{ace}(x, digits = 4, ...)
 \method{logLik}{ace}(object, ...)
 \method{deviance}{ace}(object, ...)
@@ -66,6 +66,10 @@ ace(x, phy, type = "continuous", method = if (type == "continuous")
   \item{use.eigen}{a logical (relevant if \code{type = "d"}); if
     \code{TRUE} then the probability matrix is computed with an eigen
     decomposition instead of a matrix exponential (see details).}
+  \item{marginal}{a logical (relevant if \code{type = "d"}). By default,
+    the joint reconstruction of the ancestral states are done. Set this
+    option to \code{TRUE} if you want the marginal reconstruction (see
+    details.)}
   \item{digits}{the number of digits to be printed.}
   \item{object}{an object of class \code{"ace"}.}
   \item{k}{a numeric value giving the penalty per estimated parameter;
@@ -119,6 +123,20 @@ ace(x, phy, type = "continuous", method = if (type == "continuous")
   3)}). If a short-cut is used, the number of states is determined from
   the data.
 
+  By default, the likelihood of the different ancestral states of
+  discrete characters are computed with a joint estimation procedure
+  using a procedure similar to the one described in Pupko et al. (2000).
+  If \code{marginal = TRUE}, a marginal estimation procedure is used
+  (this was the only choice until ape 3.1-1). With this second method,
+  the likelihood values at a given node are computed using only the
+  information from the tips (and branches) descending from this node.
+  With the joint estimation, all information is used for each node. The
+  difference between these two methods is further explained in
+  Felsenstein (2004, pp. 259-260) and in Yang (2006, pp. 121-126). The
+  present implementation of the joint estimation uses a ``two-pass''
+  algorithm which is much faster than stochastic mapping while the
+  estimates of both methods are very close.
+
   With discrete characters it is necessary to compute the exponential of
   the rate matrix. The only possibility until \pkg{ape} 3.0-7) was the
   function \code{\link{matexpo}} in \pkg{ape}. If \code{use.expm = TRUE}
@@ -164,6 +182,9 @@ ace(x, phy, type = "continuous", method = if (type == "continuous")
   Felsenstein, J. (1985) Phylogenies and the comparative
   method. \emph{American Naturalist}, \bold{125}, 1--15.
 
+  Felsenstein, J. (2004) \emph{Inferring Phylogenies}. Sunderland:
+  Sinauer Associates.
+
   Lebl, J. (2013) \emph{Notes on Diffy Qs: Differential Equations for
   Engineers}. \url{http://www.jirka.org/diffyqs/}.
 
@@ -177,17 +198,27 @@ ace(x, phy, type = "continuous", method = if (type == "continuous")
   characters. \emph{Proceedings of the Royal Society of London. Series
     B. Biological Sciences}, \bold{255}, 37--45.
 
+  Pupko, T., Pe'er, I, Shamir, R., and Graur, D. (2000) A fast algorithm
+  for joint reconstruction of ancestral amino acid sequences.
+  \emph{Molecular Biology and Evolution}, \bold{17}, 890--896.
+
   Schluter, D., Price, T., Mooers, A. O. and Ludwig, D. (1997)
   Likelihood of ancestor states in adaptive radiation. \emph{Evolution},
   \bold{51}, 1699--1711.
+
+  Yang, Z. (2006) \emph{Computational Molecular Evolution}. Oxford:
+  Oxford University Press.
 }
 \author{Emmanuel Paradis, Ben Bolker}
 \seealso{
-  \code{\link{MPR}}, \code{\link{corBrownian}}, \code{\link{corGrafen}},
-  \code{\link{corMartins}}, \code{\link{compar.ou}}, \code{\link[stats]{anova}}
+  \code{\link{MPR}}, \code{\link{corBrownian}}, \code{\link{compar.ou}},
+  \code{\link[stats]{anova}}
+
+  Reconstruction of ancestral sequences can be done with the package
+  \pkg{phangorn} (see function \code{?ancestral.pml}).
 }
 \examples{
-### Just some random data...
+### Some random data...
 data(bird.orders)
 x <- rnorm(23)
 ### Compare the three methods for continuous characters:
diff --git a/man/plot.phylo.Rd b/man/plot.phylo.Rd
index 3c3a0da..eb9d551 100644
--- a/man/plot.phylo.Rd
+++ b/man/plot.phylo.Rd
@@ -13,7 +13,7 @@
     cex = par("cex"), adj = NULL, srt = 0, no.margin = FALSE,
     root.edge = FALSE, label.offset = 0, underscore = FALSE,
     x.lim = NULL, y.lim = NULL, direction = "rightwards",
-    lab4ut = "horizontal", tip.color = "black", plot = TRUE,
+    lab4ut = NULL, tip.color = "black", plot = TRUE,
     rotate.tree = 0, open.angle = 0, node.depth = 1, ...)
 \method{plot}{multiPhylo}(x, layout = 1, ...)
 }
@@ -88,11 +88,12 @@
     tree. Four values are possible: "rightwards" (the default),
     "leftwards", "upwards", and "downwards".}
   \item{lab4ut}{(= labels for unrooted trees) a character string
-    specifying the display of tip labels for unrooted trees: either
-    \code{"horizontal"} where all labels are horizontal (the default),
-    or \code{"axial"} where the labels are displayed in the axis of the
-    corresponding terminal branches. This option has an effect only if
-    \code{type = "unrooted"}.}
+    specifying the display of tip labels for unrooted trees (can be
+    abbreviated): either \code{"horizontal"} where all labels are
+    horizontal (the default if \code{type = "u"}), or \code{"axial"}
+    where the labels are displayed in the axis of the corresponding
+    terminal branches. This option has an effect if \code{type = "u"},
+    \code{"f"}, or \code{"r"}.}
   \item{tip.color}{the colours used for the tip labels, eventually
     recycled (see examples).}
   \item{plot}{a logical controlling whether to draw the tree. If
@@ -101,8 +102,8 @@
   \item{rotate.tree}{for "fan", "unrooted", or "radial" trees: the
     rotation of the whole tree in degrees (negative values are
     accepted).}
-  \item{open.angle}{if \code{type = "f"}, the angle in degrees left
-    blank. Use a non-zero value if you want to call
+  \item{open.angle}{if \code{type = "f"} or \code{"r"}, the angle in
+    degrees left blank. Use a non-zero value if you want to call
     \code{\link{axisPhylo}} after the tree is plotted.}
   \item{node.depth}{an integer value (1 or 2) used if branch lengths are
     not used to plot the tree; 1: the node depths are proportional to
diff --git a/src/bionjs.c b/src/bionjs.c
index 1a9c66c..4619ffb 100644
--- a/src/bionjs.c
+++ b/src/bionjs.c
@@ -1,6 +1,6 @@
-/* bionjs.c    2013-09-26 */
+/* bionjs.c    2014-03-21 */
 
-/* Copyright 2011-2012 Andrei-Alin Popescu */
+/* Copyright 2011-2014 Andrei-Alin Popescu */
 
 /* This file is part of the R-package `ape'. */
 /* See the file ../COPYING for licensing issues. */
@@ -209,11 +209,20 @@ void C_bionjs(double *D, int *N, int *edge1, int *edge2, double *edge_length, in
                 //if we stil have incomplete distances
                 if(sw==1)
                 {
-                 lamb=0.5+(1/(2*(s[give_index(OTU1,OTU2,n)]-2)*v[give_index(OTU2,OTU1,n)]))*lambSum;
+		    if(v[give_index(OTU2,OTU1,n)]!=0.0)
+			lamb=0.5+(1.0/(2*(s[give_index(OTU1,OTU2,n)]-2)*v[give_index(OTU2,OTU1,n)]))*lambSum;
+		    else
+			lamb=0.5;
+		    if(lamb<0.0)lamb=0.0;
+		    if(lamb>1.0)lamb=1.0;
                 }else{
-                 lamb=0.5+(1/(2*(n-2)*v[give_index(OTU2,OTU1,n)]))*lambSum;
-                     }
-
+		    if(v[give_index(OTU2,OTU1,n)]!=0.0)
+			lamb=0.5+(1.0/(2*(n-2)*v[give_index(OTU1,OTU2,n)]))*lambSum;
+		    else
+			lamb=0.5;
+		    if(lamb<0.0)lamb=0.0;
+		    if(lamb>1.0)lamb=1.0;
+		}
                 //although s was updated above, s[otu1,otu2] has remained unchanged
                 //so it is safe to use it here
                 //if complete distanes, use N-2, else use S

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-ape.git



More information about the debian-med-commit mailing list