Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit cd7c8a7

Browse files
authored
Update cutoff_methods.R
Updating cutoff to return max height value
1 parent 331bd19 commit cd7c8a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/cutoff_methods.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ cutoff_first_bin <- function(hcl, num_bins, check_skew=TRUE) {
2727
if (check_skew){
2828
mid <- median(seq(num_bins))
2929
if (sum(bin_idx[1L:(mid-1L)]) < sum(bin_idx[mid:num_bins])){
30-
return(as.vector(cutree(hcl, k = 1L)))
30+
return(max(hcl$height))
31+
# return(as.vector(cutree(hcl, k = 1L)))
3132
}
3233
}
3334

@@ -68,4 +69,4 @@ cutoff_first_threshold <- function(hcl, threshold = 0.0, ...){
6869
return(ifelse(is.na(cut_idx) || cut_idx == 1L, max(hcl$height), f_h$x[cut_idx]))
6970
# if (is.na(cut_idx) || cut_idx == 1L) { as.vector(cutree(hcl, k = 1L)) }
7071
# else { as.vector(cutree(hcl, h = )) }
71-
}
72+
}

0 commit comments

Comments
 (0)