Skip to content

Commit 323a24c

Browse files
committed
fix(EnrichmentPlot): ensure unique top terms in EnrichmentPlot by disabling ties in slice_min
1 parent 2f0ee0e commit 323a24c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ Rplots.pdf
66
inst/doc
77
notebooks/spatial/data/
88
notebooks/data/
9+
.vscode/mcp.json
10+
scplotter_presentation.pptx

R/enrichmentplot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ EnrichmentPlot <- function(
123123
if (!is.null(split_by) || !is.null(group_by) || !is.null(facet_by)) {
124124
data <- data %>%
125125
group_by(!!!syms(unique(c(split_by, group_by, facet_by)))) %>%
126-
slice_min(!!sym(metric), n = top_term) %>%
126+
slice_min(!!sym(metric), n = top_term, with_ties = FALSE) %>%
127127
ungroup()
128128
} else {
129-
data <- data %>% slice_min(!!sym(metric), n = top_term)
129+
data <- data %>% slice_min(!!sym(metric), n = top_term, with_ties = FALSE)
130130
}
131131

132132
# preprocessing

0 commit comments

Comments
 (0)