Skip to content

Commit

Permalink
incorrect # of rectangles issue in rect.dendogram fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
alecbuetow committed Sep 24, 2024
1 parent 72e055b commit b0fa739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/rect.dendrogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ rect.dendrogram <- function(tree, k = NULL, which = NULL, x = NULL, h = NULL, bo
stop("specify exactly one of 'k' and 'h'")
}

ss_ks <- tree_heights < h
k <- min(as.numeric(names(ss_ks))[ss_ks])
ss_ks <- tree_heights > h
k <- max(as.numeric(names(ss_ks))[ss_ks])
k <- max(k, 2) # I don't like this default...
}
else if (is.null(k)) {
Expand Down

0 comments on commit b0fa739

Please sign in to comment.