]> git.donarmstrong.com Git - ape.git/commitdiff
changed rtree and rcoal
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 3 Nov 2009 07:24:34 +0000 (07:24 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 3 Nov 2009 07:24:34 +0000 (07:24 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@97 6e262413-ae40-0410-9e79-b911bd7a66b7

31 files changed:
ChangeLog
DESCRIPTION
R/rtree.R
man/Initialize.corPhyl.Rd
man/all.equal.phylo.Rd
man/as.alignment.Rd
man/as.phylo.Rd
man/axisPhylo.Rd
man/birthdeath.Rd
man/compar.gee.Rd
man/compute.brlen.Rd
man/consensus.Rd
man/corBrownian.Rd
man/corGrafen.Rd
man/corMartins.Rd
man/identify.phylo.Rd
man/is.monophyletic.Rd
man/ltt.plot.Rd
man/makeLabel.Rd
man/mantel.test.Rd
man/mst.Rd
man/phymltest.Rd
man/plot.ancestral.Rd
man/plot.phylo.Rd
man/print.phylo.Rd
man/rtree.Rd
man/skyline.Rd
man/subtreeplot.Rd
man/summary.phylo.Rd
man/write.nexus.Rd
man/zoom.Rd

index 296d65759937e493934285b52542f25a1c42f61c..46aa1e3b065d760852511aa9ecfcea8b573e1f01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
                CHANGES IN APE VERSION 2.4-1
 
 
+NEW FEATURES
+
+    o rtree() and rcoal() now accept a numeric vector for the 'br'
+      argument.
+
+
 BUG FIXES
 
     o bind.tree() failed when 'y' had no root edge.
index be5a57a95a240a29a796217eb26efceeb62d8a9d..d9fdc2e023d22704237a81121c40286afba7d8ed 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.4-1
-Date: 2009-10-27
+Date: 2009-11-03
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
index 6829b02d294be46753894cea6f074f5e09bfbd3d..030b47e77885a70a4cc1b362d461878133ce8dc5 100644 (file)
--- a/R/rtree.R
+++ b/R/rtree.R
@@ -1,4 +1,4 @@
-## rtree.R (2000-05-13)
+## rtree.R (2009-11-03)
 
 ##   Generates Random Trees
 
@@ -94,7 +94,10 @@ rtree <- function(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
     phy$tip.label <-
       if (is.null(tip.label)) paste("t", sample(n), sep = "")
       else sample(tip.label)
-    if (is.function(br)) phy$edge.length <- br(nbr, ...)
+    if (!is.null(br)) {
+        phy$edge.length <-
+            if (is.function(br)) br(nbr, ...) else rep(br, length.out = nbr)
+    }
     phy$Nnode <- n - 2L + rooted
     class(phy) <- "phylo"
     phy
@@ -107,7 +110,7 @@ rcoal <- function(n, tip.label = NULL, br = "coalescent", ...)
     edge <- matrix(NA, nbr, 2)
     ## coalescence times by default:
     x <- if (is.character(br)) 2*rexp(n - 1)/(as.double(n:2) * as.double((n - 1):1))
-    else br(n - 1, ...)
+    else if (is.numeric(br)) rep(br, length.out = n - 1) else br(n - 1, ...)
     if (n == 2) {
         edge[] <- c(3L, 3L, 1:2)
         edge.length <- rep(x, 2)
index 7e0c0c789355e857ee4c30a5b9ede04a26cca0cb..875e39e3314e0c2b1055ba442f0e044ea21ad457 100644 (file)
@@ -7,7 +7,7 @@
 \arguments{
        \item{object}{An object inheriting from class \code{corPhyl}.}
        \item{data}{The data to use. If it contains rownames, they are matched with the tree tip labels, otherwise data are supposed to be in the same order than tip labels and a warning is sent.}
-       \item{...}{some methods for this generic require additional arguments. None are used in this method.}
+       \item{\dots}{some methods for this generic require additional arguments. None are used in this method.}
 }
 \description{
        Initialize a \code{corPhyl} correlation structure object.
index f11afeb6ea4047a4ed352784937a75bef6bb0407..7c1003de174a447ae95d5f119fa2921cfaa60cce 100644 (file)
@@ -21,7 +21,7 @@
     lengths.}
   \item{scale}{a positive number, comparison of branch lengths is made
     after scaling (i.e., dividing) them by this number.}
-  \item{...}{further arguments passed to or from other methods.}
+  \item{\dots}{further arguments passed to or from other methods.}
 }
 \description{
   This function makes a global comparison of two phylogenetic trees.
index a60eec8b8d6fd29a0261ab2ebb55d9121d31f941..47de1d2d9526f0cbc5960b7ffaeb8993ae44a4ec 100644 (file)
@@ -25,7 +25,7 @@ as.DNAbin(x, ...)
 \arguments{
   \item{x}{a matrix or a list containing the DNA sequences, or an object
     of class \code{"alignment"}.}
-  \item{...}{further arguments to be passed to or from other methods.}
+  \item{\dots}{further arguments to be passed to or from other methods.}
 }
 \details{
   For \code{as.alignment}, the sequences given as argument should be
index d7118f0d7bb8567e74d89e9ac6920f155ce9c276..4b757ac08960f10cad988410766009abd197827a 100644 (file)
@@ -16,7 +16,7 @@ new2old.phylo(phy)
 }
 \arguments{
   \item{x}{an object to be converted into another class.}
-  \item{...}{further arguments to be passed to or from other methods.}
+  \item{\dots}{further arguments to be passed to or from other methods.}
   \item{phy}{an object of class \code{"phylo"}.}
 }
 \description{
index ff03ef4828473e8d426ab7754679835a5c4128e2..b96c83172ae34628189de64d02053cbc20ca33dc 100644 (file)
@@ -7,7 +7,7 @@ axisPhylo(side = 1, ...)
 \arguments{
   \item{side}{a numeric value specifying the side where the axis is
     plotted: 1: below, 2: left, 3: above, 4: right.}
-  \item{...}{further arguments to be passed to \code{axis}.}
+  \item{\dots}{further arguments to be passed to \code{axis}.}
 }
 \description{
   This function adds a scaled axis on the side of a phylogeny plot.
index 709a74071b96fe289d7dfc978a4f59d632d6d047..b91d5628a3fd9d3e373085ed690c460f4dc37c1b 100644 (file)
@@ -9,7 +9,7 @@ birthdeath(phy)
 \arguments{
   \item{phy}{an object of class \code{"phylo"}.}
   \item{x}{an object of class \code{"birthdeath"}.}
-  \item{...}{further arguments passed to the \code{print} function.}
+  \item{\dots}{further arguments passed to the \code{print} function.}
 }
 \description{
   This function fits by maximum likelihood a birth-death model to the
index e44b43339e2677ac51cd54f2cefa171528609bec..28ceb8bbc54ebad78c94e99db15103202a711e5d 100644 (file)
@@ -27,7 +27,7 @@ compar.gee(formula, data = NULL, family = "gaussian", phy,
   \item{scope}{<unused>.}
   \item{quiet}{a logical specifying whether to display a warning message
     about eventual ``marginality principle violation''.}
-  \item{...}{further arguments to be passed to \code{drop1}.}
+  \item{\dots}{further arguments to be passed to \code{drop1}.}
 }
 \description{
   \code{compar.gee} performs the comparative analysis using generalized
index 8e6a7c6a54fb3ccc5189c9a98865cc1975ae1d91..fa0fbd0509f34c637d95f88ecad0b19057991bfb 100644 (file)
@@ -10,7 +10,7 @@ compute.brlen(phy, method = "Grafen", power = 1, ...)
     this must be one of the followings: (i) \code{"Grafen"} (the
     default), (ii) a numeric vector, or (iii) a function.}
   \item{power}{The power at which heights must be raised (see below).}
-  \item{...}{further argument(s) to be passed to \code{method} if it is
+  \item{\dots}{further argument(s) to be passed to \code{method} if it is
     a function.}
 }
 \description{
index 6e1f5caa6b1c89534f3d9fcf371774538c2ab30b..bbedf3706d11cf6f30b63e57c227db3527bedbf5 100644 (file)
@@ -5,7 +5,7 @@
 consensus(..., p = 1, check.labels = TRUE)
 }
 \arguments{
-  \item{...}{either (i) a single object of class \code{"phylo"}, (ii) a
+  \item{\dots}{either (i) a single object of class \code{"phylo"}, (ii) a
     series of such objects separated by commas, or (iii) a list
     containing such objects.}
   \item{p}{a numeric value between 0.5 and 1 giving the proportion for a
index 6ed05742b445e395f28ffe9cbca80da601bbdab4..46c575323cac285e121da7e8c381cac0d85d796c 100644 (file)
@@ -22,7 +22,7 @@
     in unconstrained form (the same used in the optimization
     algorithm). If 'FALSE' the coefficients are returned in
     "natural", possibly constrained, form. Defaults to 'TRUE'}
-       \item{...}{some methods for these generics require additional arguments.
+       \item{\dots}{some methods for these generics require additional arguments.
                None are used in these methods.}
 }
 \description{
index 9f063da94e332d1a17fce808750fbe87c3a2c1bc..46df0550f8592b71bf350c74a7756d84c9169796 100644 (file)
@@ -27,7 +27,7 @@ corGrafen(value, phy, form=~1, fixed = FALSE)
     returned in unconstrained form (the same used in the optimization
     algorithm). If 'FALSE' the coefficients are returned in "natural",
     possibly constrained, form. Defaults to 'TRUE'}
-  \item{...}{some methods for these generics require additional
+  \item{\dots}{some methods for these generics require additional
     arguments. None are used in these methods.}
 }
 \description{
index 44ac224be72762eec78e55da32d37ea0522069ea..f6f673a24add168d4c86b7b7934f56efd500ecde 100644 (file)
@@ -27,7 +27,7 @@ corMartins(value, phy, form=~1, fixed = FALSE)
     in unconstrained form (the same used in the optimization
     algorithm). If 'FALSE' the coefficients are returned in
     "natural", possibly constrained, form. Defaults to 'TRUE'}
-       \item{...}{some methods for these generics require additional arguments.
+       \item{\dots}{some methods for these generics require additional arguments.
                None are used in these methods.}
 }
 \description{
index 3cd3af9cac7c6179b2967be3251c491bb4a1cc50..7e05425b114efffdcf6bfb1d26ed160f6a975d1d 100644 (file)
@@ -12,7 +12,7 @@
     information.}
   \item{labels}{a logical specifying whether to return the labels; by
     default only the numbers are returned.}
-  \item{...}{further arguments to be passed to or from other methods.}
+  \item{\dots}{further arguments to be passed to or from other methods.}
 }
 \description{
   This function allows to identify a clade on a plotted tree by clicking
index 5de597696182416dc2f7b72066fc59d6efbcf0f7..1c170a753a05700be49d2416330e17ad0c3a939a 100644 (file)
@@ -22,7 +22,7 @@ is.monophyletic(phy, tips, reroot = !is.rooted(phy), plot = FALSE, ...)
     \item{plot}{
         a logical. If \code{TRUE}, then the tree is plotted with the specified group \code{tips} highlighted.
     }
-    \item{...}{
+    \item{\dots}{
        further arguments passed to \code{plot}.
     }
 }
index 2b192efd2bb6d798e372b188bcdbd5827e831637..a36ec22c52a8ccaa6af622b5edda8c3b342d7917 100644 (file)
@@ -15,7 +15,7 @@ mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
   \item{xlab}{a character string (or a variable of mode character)
     giving the label for the x-axis (default is "Time").}
   \item{ylab}{idem for the y-axis (default is "N").}
-  \item{...}{in the cases of \code{ltt.plot()} and \code{ltt.lines()}
+  \item{\dots}{in the cases of \code{ltt.plot()} and \code{ltt.lines()}
     these are further (graphical) arguments to be passed to
     \code{plot()} or \code{lines()}, respectively (see \code{Details:}
     on how to transform the axes); in the case \code{mltt.plot()} these
index b48718b2f6efe37e131c982cd23c16afe0be2e1d..758769a06e6bdcaa81f0b167f28082438e5456fc 100644 (file)
@@ -30,7 +30,7 @@ makeLabel(x, ...)
     modified; \code{TRUE} by default.}
   \item{nodes}{a logical specifying whether node labels are to be
     modified; \code{TRUE} by default.}
-  \item{...}{further arguments to be passed to or from other methods.}
+  \item{\dots}{further arguments to be passed to or from other methods.}
 }
 \description{
   This is a generic function with methods for character vectors, trees
index 78624a80df699af41f3458b5aad0169135b84185..72a6009070cc4c92582d925f4dcc468b3ee769ec 100644 (file)
@@ -12,7 +12,7 @@ mantel.test(m1, m2, nperm = 1000, graph = FALSE, ...)
   \item{nperm}{the number of times to permute the data.}
   \item{graph}{a logical indicating whether to produce a summary graph
     (by default the graph is not plotted).}
-  \item{...}{further arguments to be passed to \code{plot()} (to add a
+  \item{\dots}{further arguments to be passed to \code{plot()} (to add a
     title, change the axis labels, and so on).}
 }
 \description{
index 556d706097d3f85ff119bf2e917f491e3dd47d7c..e2c0f604a4fcf378b8abff7c6fd767ae685b115b 100644 (file)
@@ -23,7 +23,7 @@ mst(X)
   \item{x2}{a numeric vector giving the coordinates of the observations
     on the \emph{y}-axis. Both \code{x1} and \code{x2} must be specified
     to be used.}
-  \item{...}{further arguments to be passed to \code{plot()}.}
+  \item{\dots}{further arguments to be passed to \code{plot()}.}
 }
 \description{
   The function \code{mst} finds the minimum spanning tree between a set of
index d4587cc6e104b6418c106117b5f63f61abf32de5..762aee18016b2d48a8c21118eb847bce6897bea4 100644 (file)
@@ -37,7 +37,7 @@ phymltest(seqfile, format = "interleaved", itree = NULL,
     title).}
   \item{col}{a colour used for the segments showing the AIC values (blue
     by default).}
-  \item{...}{further arguments passed to or from other methods.}
+  \item{\dots}{further arguments passed to or from other methods.}
 }
 \description{
   This function calls PhyML and fits successively 28 models of DNA
index d0a39a088189ee963ead35b88300ce1ebf2f2767..4279432860c0a01f268f8e300dd490fdd294a3c3 100644 (file)
@@ -20,7 +20,7 @@ ask = prod(par("mfcol")) < length(which) && dev.interactive(),
   \item{col.fun}{the color function to use.}
   \item{plot.node.values}{Should character values used as node labels?}
   \item{ask}{Ask before each plot?}
-  \item{...}{Further parameters to pass to the plot.phylo function.}
+  \item{\dots}{Further parameters to pass to the plot.phylo function.}
 }
 \details{
   This function produces one plot by selected ancestral character. It
index ba98021ef7374fc5ee5199024f47960293b3210d..52a726a952cdea3743e298c679a230052a99bcea 100644 (file)
@@ -91,7 +91,7 @@
   \item{tip.color}{the colours used for the tip labels, eventually
     recycled (see examples).}
   \item{layout}{the number of trees to be plotted simultaneously.}
-  \item{...}{further arguments to be passed to \code{plot} or to
+  \item{\dots}{further arguments to be passed to \code{plot} or to
     \code{plot.phylo}.}
 }
 \description{
index 1d216b3e6f69fe50cd8416e7ef73f1ffefc55dd0..0a78b9624f59aaa51c78989409f049781b05c6e5 100644 (file)
@@ -23,7 +23,7 @@
   \item{i}{indices of the tree(s) to select from a list; this may be a
     vector of integers, logicals, or names.}
   \item{name}{a character string specifying the tree to be extracted.}
-  \item{...}{further arguments passed to or from other methods.}
+  \item{\dots}{further arguments passed to or from other methods.}
 }
 \description{
   These functions prints a compact summary of a phylogeny, or a list of,
index 48401b5b8341e8a15b439ecbc0a2f599db763319..5f6a7fd179d5c090c133fa1970e26cfdcbf04b31 100644 (file)
@@ -14,11 +14,13 @@ rmtree(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
     (the default).}
   \item{tip.label}{a character vector giving the tip labels; if not
     specified, the tips "t1", "t2", ..., are given.}
-  \item{br}{an R function used to generate the branch lengths
-    (\code{rtree}; use \code{NULL} to simulate only a topology), or the
-    coalescence times (\code{rcoal}). For the latter, a genuine
-    coalescent tree is simulated by default.}
-  \item{...}{further argument(s) to be passed to \code{br}.}
+  \item{br}{one of the following: (i) an R function used to generate the
+    branch lengths (\code{rtree}; use \code{NULL} to simulate only a
+    topology), or the coalescence times (\code{rcoal}); (ii) a character
+    to simulate a genuine coalescent tree for \code{rcoal} (the
+    default); or (iii) a numeric vector for the branch lengths or the
+    coalescence times.}
+  \item{\dots}{further argument(s) to be passed to \code{br}.}
   \item{N}{an integer giving the number of trees to generate.}
 }
 \description{
index fa3d1c6bb5ee1469fc96cb2743873367083d80dc..718ff2276336001c06e8fcd5307e7a70a29fdd8b 100644 (file)
@@ -32,7 +32,7 @@ find.skyline.epsilon(ci, GRID=1000, MINEPS=1e-6, \dots)
   
   \item{MINEPS}{Parameter for the grid search for \code{epsilon} in \code{find.skyline.epsilon}.}
   
-  \item{...}{Any of the above parameters.}
+  \item{\dots}{Any of the above parameters.}
   
 }
 \description{
index f72ab8f076c7b0465d02b0b64ab0271bdfade449..ce6863ecdde096270d3e6b73fdf88f58d8a7d76b 100644 (file)
@@ -12,7 +12,7 @@ subtreeplot(x, wait=FALSE, ...)
 \arguments{
   \item{x}{an object of class \code{"phylo"}.}
   \item{wait}{a logical indicating whether the node beeing processed should be printed (useful for big phylogenies).}
-  \item{...}{further arguments passed to \code{plot.phylo}.}
+  \item{\dots}{further arguments passed to \code{plot.phylo}.}
 }
 \details{
   This function aims at easily exploring very large trees. The main argument is
index d24dea0c8fef8a2f49fc20e4525508d47bb793af..3904a4b882f025dfe15456e64586166c95696bc8 100644 (file)
@@ -12,7 +12,7 @@ Nedge(phy)
 }
 \arguments{
   \item{object, phy}{an object of class \code{"phylo"}.}
-  \item{...}{further arguments passed to or from other methods.}
+  \item{\dots}{further arguments passed to or from other methods.}
   \item{internal.only}{a logical indicating whether to return the number
     of internal nodes only (the default), or of internal and terminal
     (tips) nodes (if \code{FALSE}).}
index 05341ff9650ff02a82704874d29f5cc2e9e382c2..fb5d653c834c4c252666856ab6263983e03ec5f1 100644 (file)
@@ -5,7 +5,7 @@
 write.nexus(..., file = "", translate = TRUE, original.data = TRUE)
 }
 \arguments{
-  \item{...}{either (i) a single object of class \code{"phylo"}, (ii) a
+  \item{\dots}{either (i) a single object of class \code{"phylo"}, (ii) a
     series of such objects separated by commas, or (iii) a list
     containing such objects.}
   \item{file}{a file name specified by either a variable of mode character,
index 53d80b65c13c3dc26d97731c963472bf73d903a6..314f3a3fe4b4028833d6b677a2ef258d83273ac1 100644 (file)
@@ -16,7 +16,7 @@ zoom(phy, focus, subtree = FALSE, col = rainbow, ...)
     extracted subtrees.}
   \item{col}{a vector of colours used to show where the subtrees are in
     the main tree, or a function .}
-  \item{...}{further arguments passed to \code{plot.phylo}.}
+  \item{\dots}{further arguments passed to \code{plot.phylo}.}
 }
 \details{
   This function aims at exploring very large trees. The main argument is