]> git.donarmstrong.com Git - ape.git/blobdiff - R/rtree.R
new function rmtree
[ape.git] / R / rtree.R
index 2e1a8a4778ba11d3b35859da41658e48f360b7a3..6d0172c1ef8b5029739dbd91eb7d027064f1e37f 100644 (file)
--- a/R/rtree.R
+++ b/R/rtree.R
@@ -1,8 +1,8 @@
-## rtree.R (2007-12-22)
+## rtree.R (2008-01-08)
 
 ##   Generates Random Trees
 
-## Copyright 2004-2007 Emmanuel Paradis
+## Copyright 2004-2008 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -138,3 +138,11 @@ rcoal <- function(n, tip.label = NULL, br = rexp, ...)
     ## to avoid crossings when converting with as.hclust:
     read.tree(text = write.tree(phy))
 }
+
+rmtree <- function(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
+{
+    a <- replicate(N, rtree(n, rooted = rooted, tip.label =  tip.label,
+                            br = br, ...), simplify = FALSE)
+    class(a) <- "multiPhylo"
+    a
+}