Skip to content

Commit

Permalink
syntax tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ms609 committed May 28, 2024
1 parent c783b01 commit 6674ed4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/Concordance.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ QuartetConcordance <- function (tree, dataset = NULL) {

#' @importFrom TreeDist Entropy
.Entropy <- function (...) {
Entropy (c(...) / sum(...))
Entropy(c(...) / sum(...))
}

#' @rdname SiteConcordance
Expand Down
16 changes: 8 additions & 8 deletions R/PlotCharacter.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ PlotCharacter <- function (tree, dataset, char = 1L,
right <- left
parentOf <- integer(nNode + nTip)
for (e in seq_len(dim(edge)[1])) {
pa <- parent[e]
ch <- child[e]
parentOf[ch] <- pa
if (right[pa]) {
left[pa] <- ch
pa <- parent[[e]]
ch <- child[[e]]
parentOf[[ch]] <- pa
if (right[[pa]]) {
left[[pa]] <- ch
} else {
right[pa] <- ch
right[[pa]] <- ch
}
}
preOrderNodes <- unique(rev(parent)) # Root guaranteed first
postOrderNodes <- rev(preOrderNodes)
rootNode <- preOrderNodes[1]
parentOf[rootNode] <- rootNode
rootNode <- preOrderNodes[[1]]
parentOf[[rootNode]] <- rootNode
tips <- seq_len(nTip)

# Read states
Expand Down

0 comments on commit 6674ed4

Please sign in to comment.