Permalink
Browse files

as.multiPhylo for phylo object

  • Loading branch information...
liamrevell committed Dec 28, 2016
1 parent 53e8190 commit 76b66c8b1adee49ad27a193f19161dfbcbbce878
Showing with 14 additions and 5 deletions.
  1. +4 −4 DESCRIPTION
  2. +1 −0 NAMESPACE
  3. +8 −0 R/utilities.R
  4. +1 −1 man/as.multiPhylo.Rd
View
@@ -1,6 +1,6 @@
Package: phytools
-Version: 0.5-66
-Date: 2016-12-25
+Version: 0.5-67
+Date: 2016-12-27
Title: Phylogenetic Tools for Comparative Biology (and Other Things)
Author: Liam J. Revell
Maintainer: Liam J. Revell <liam.revell@umb.edu>
@@ -56,6 +56,6 @@ Description: Package contains various functions for phylogenetic analysis.
research.
License: GPL (>= 2)
URL: http://github.com/liamrevell/phytools
-Packaged: 2016-12-25 12:00:00 EST
+Packaged: 2016-12-27 12:00:00 EST
Repository:
-Date/Publication: 2016-12-25 12:00:00 EST
+Date/Publication: 2016-12-27 12:00:00 EST
View
@@ -76,6 +76,7 @@ S3method(AIC, fitMk)
S3method(print, phylo.to.map)
S3method(as.phylo, simmap)
S3method(as.multiPhylo, multiSimmap)
+S3method(as.multiPhylo, phylo)
S3method(plot, fitPagel)
S3method(plot, fitMk)
S3method(plot, gfit)
View
@@ -176,6 +176,14 @@ as.multiPhylo.multiSimmap<-function(x,...){
obj
}
+## generic function to convert object of class "phylo" to "multiPhylo"
+## written by Liam J. Revell 2016
+as.multiPhylo.phylo<-function(x,...){
+ obj<-list(x)
+ class(obj)<-"multiPhylo"
+ obj
+}
+
as.multiPhylo<-function(x,...){
if (identical(class(x),"multiPhylo")) return(x)
UseMethod("as.multiPhylo")
View
@@ -7,7 +7,7 @@ as.multiPhylo(x, ...)
\method{as.multiPhylo}{multiSimmap}(x, ...)
}
\arguments{
- \item{x}{object to be converted to \code{"multiPhylo"}. Presently an object of class \code{"multiSimmap"}.}
+ \item{x}{object to be converted to \code{"multiPhylo"}. Presently an object of class \code{"multiSimmap"}, or an object of class \code{"phylo"}. In the latter case an object of class \code{"multiPhylo"} with length \code{1} is generated.}
\item{...}{optional arguments.}
}
\description{

0 comments on commit 76b66c8

Please sign in to comment.