Skip to content

Commit

Permalink
fixed edge.length in get.tree.dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
brj1 committed Dec 2, 2016
1 parent 40b2729 commit b7f03d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Authors@R: c(
person("Justin", "Silverman", email = "[email protected]", rol = "ctb", comment = "geom_balance"),
person("Casey", "Dunn", email = "[email protected]", rol = "ctb",
comment = "NHX")
person("Bradley", "Jones", email = "[email protected]", rol = "ctb",
comment = "get.tree method for data.frame")
)
Maintainer: Guangchuang Yu <[email protected]>
Description: 'ggtree' extends the 'ggplot2' plotting system which implemented the grammar of graphics.
Expand Down
6 changes: 3 additions & 3 deletions R/method-get-tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ setMethod("get.tree", signature(object="phylo"),
##' @exportMethod get.tree
setMethod("get.tree", signature(object="data.frame"),
function(object, ...) {
edge <- object[, c("parent", "node")]
edge <- edge[edge[,1] != 0 & edge[,1] != edge[,2], ]
edge.length <- object[, "branch.length"]
i <- which(edge[,1] != 0 & edge[,1] != edge[,2])
edge <- edge[i, ]
edge.length <- object[i, "branch.length"]
tip.label <- object[object[, "isTip"], "label"]
phylo <- list(edge = edge,
edge.length = edge.length,
Expand Down

0 comments on commit b7f03d0

Please sign in to comment.