From: paradis Date: Tue, 3 Nov 2009 07:24:34 +0000 (+0000) Subject: changed rtree and rcoal X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=commitdiff_plain;h=8e2e1ceb81f455bcb7b184d114913295d67b93c4 changed rtree and rcoal git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@97 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/ChangeLog b/ChangeLog index 296d657..46aa1e3 100644 --- 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. diff --git a/DESCRIPTION b/DESCRIPTION index be5a57a..d9fdc2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/R/rtree.R b/R/rtree.R index 6829b02..030b47e 100644 --- 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) diff --git a/man/Initialize.corPhyl.Rd b/man/Initialize.corPhyl.Rd index 7e0c0c7..875e39e 100644 --- a/man/Initialize.corPhyl.Rd +++ b/man/Initialize.corPhyl.Rd @@ -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. diff --git a/man/all.equal.phylo.Rd b/man/all.equal.phylo.Rd index f11afeb..7c1003d 100644 --- a/man/all.equal.phylo.Rd +++ b/man/all.equal.phylo.Rd @@ -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. diff --git a/man/as.alignment.Rd b/man/as.alignment.Rd index a60eec8..47de1d2 100644 --- a/man/as.alignment.Rd +++ b/man/as.alignment.Rd @@ -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 diff --git a/man/as.phylo.Rd b/man/as.phylo.Rd index d7118f0..4b757ac 100644 --- a/man/as.phylo.Rd +++ b/man/as.phylo.Rd @@ -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{ diff --git a/man/axisPhylo.Rd b/man/axisPhylo.Rd index ff03ef4..b96c831 100644 --- a/man/axisPhylo.Rd +++ b/man/axisPhylo.Rd @@ -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. diff --git a/man/birthdeath.Rd b/man/birthdeath.Rd index 709a740..b91d562 100644 --- a/man/birthdeath.Rd +++ b/man/birthdeath.Rd @@ -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 diff --git a/man/compar.gee.Rd b/man/compar.gee.Rd index e44b433..28ceb8b 100644 --- a/man/compar.gee.Rd +++ b/man/compar.gee.Rd @@ -27,7 +27,7 @@ compar.gee(formula, data = NULL, family = "gaussian", phy, \item{scope}{.} \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 diff --git a/man/compute.brlen.Rd b/man/compute.brlen.Rd index 8e6a7c6..fa0fbd0 100644 --- a/man/compute.brlen.Rd +++ b/man/compute.brlen.Rd @@ -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{ diff --git a/man/consensus.Rd b/man/consensus.Rd index 6e1f5ca..bbedf37 100644 --- a/man/consensus.Rd +++ b/man/consensus.Rd @@ -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 diff --git a/man/corBrownian.Rd b/man/corBrownian.Rd index 6ed0574..46c5753 100644 --- a/man/corBrownian.Rd +++ b/man/corBrownian.Rd @@ -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{ diff --git a/man/corGrafen.Rd b/man/corGrafen.Rd index 9f063da..46df055 100644 --- a/man/corGrafen.Rd +++ b/man/corGrafen.Rd @@ -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{ diff --git a/man/corMartins.Rd b/man/corMartins.Rd index 44ac224..f6f673a 100644 --- a/man/corMartins.Rd +++ b/man/corMartins.Rd @@ -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{ diff --git a/man/identify.phylo.Rd b/man/identify.phylo.Rd index 3cd3af9..7e05425 100644 --- a/man/identify.phylo.Rd +++ b/man/identify.phylo.Rd @@ -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 diff --git a/man/is.monophyletic.Rd b/man/is.monophyletic.Rd index 5de5976..1c170a7 100644 --- a/man/is.monophyletic.Rd +++ b/man/is.monophyletic.Rd @@ -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}. } } diff --git a/man/ltt.plot.Rd b/man/ltt.plot.Rd index 2b192ef..a36ec22 100644 --- a/man/ltt.plot.Rd +++ b/man/ltt.plot.Rd @@ -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 diff --git a/man/makeLabel.Rd b/man/makeLabel.Rd index b48718b..758769a 100644 --- a/man/makeLabel.Rd +++ b/man/makeLabel.Rd @@ -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 diff --git a/man/mantel.test.Rd b/man/mantel.test.Rd index 78624a8..72a6009 100644 --- a/man/mantel.test.Rd +++ b/man/mantel.test.Rd @@ -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{ diff --git a/man/mst.Rd b/man/mst.Rd index 556d706..e2c0f60 100644 --- a/man/mst.Rd +++ b/man/mst.Rd @@ -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 diff --git a/man/phymltest.Rd b/man/phymltest.Rd index d4587cc..762aee1 100644 --- a/man/phymltest.Rd +++ b/man/phymltest.Rd @@ -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 diff --git a/man/plot.ancestral.Rd b/man/plot.ancestral.Rd index d0a39a0..4279432 100644 --- a/man/plot.ancestral.Rd +++ b/man/plot.ancestral.Rd @@ -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 diff --git a/man/plot.phylo.Rd b/man/plot.phylo.Rd index ba98021..52a726a 100644 --- a/man/plot.phylo.Rd +++ b/man/plot.phylo.Rd @@ -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{ diff --git a/man/print.phylo.Rd b/man/print.phylo.Rd index 1d216b3..0a78b96 100644 --- a/man/print.phylo.Rd +++ b/man/print.phylo.Rd @@ -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, diff --git a/man/rtree.Rd b/man/rtree.Rd index 48401b5..5f6a7fd 100644 --- a/man/rtree.Rd +++ b/man/rtree.Rd @@ -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{ diff --git a/man/skyline.Rd b/man/skyline.Rd index fa3d1c6..718ff22 100644 --- a/man/skyline.Rd +++ b/man/skyline.Rd @@ -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{ diff --git a/man/subtreeplot.Rd b/man/subtreeplot.Rd index f72ab8f..ce6863e 100644 --- a/man/subtreeplot.Rd +++ b/man/subtreeplot.Rd @@ -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 diff --git a/man/summary.phylo.Rd b/man/summary.phylo.Rd index d24dea0..3904a4b 100644 --- a/man/summary.phylo.Rd +++ b/man/summary.phylo.Rd @@ -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}).} diff --git a/man/write.nexus.Rd b/man/write.nexus.Rd index 05341ff..fb5d653 100644 --- a/man/write.nexus.Rd +++ b/man/write.nexus.Rd @@ -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, diff --git a/man/zoom.Rd b/man/zoom.Rd index 53d80b6..314f3a3 100644 --- a/man/zoom.Rd +++ b/man/zoom.Rd @@ -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