Skip to content

Commit

Permalink
simplified cast of simulate.binary.dated.tree.fgy output to phylo object
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtPoon committed Jun 26, 2017
1 parent 77d3ec2 commit f0d4cf0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/R/compartmental-models.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ require(rcolgem, quietly=TRUE)
sampleStates,
integrationMethod=integrationMethod # , n.reps=nreps --this isn't a parameter in rcolgem's simulate.binary.dated.tree.fgy
)
return(tree)
phy <- tree[[1]]
class(phy) <- 'phylo'
return(phy)
# return(tree)

# https://github.com/cran/ape/blob/master/R/rtree.R converting tree result into an ape phylo object phy
tree <- tree[[1]]
phy <- list(edge=tree$edge, edge.length=tree$edge.length)
if (is.null(tree$tip.label))
tree$tip.label <- paste("t", 1:tree$n) # n = number of tips
Expand Down

0 comments on commit f0d4cf0

Please sign in to comment.