Skip to content

Commit e01324c

Browse files
committed
Fix issue with blank page produced by UpSetR::upset().
hms-dbmi/UpSetR#101 hms-dbmi/UpSetR#90 (comment)
1 parent f76d44b commit e01324c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/upset.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ getResultsUpset <- function(
263263
#' * Added Inference.Results as first argument
264264
#' * Changed `id` to be set to the name of the first column
265265
#' * Changed `<=` and `>=` to `<` and `>`, respectively, to match app UI
266+
#' * Set `newpage = FALSE` when printing to avoid blank page
266267
#'
267268
#' @noRd
268269
InferenceUpsetPlot <- function(Inference.Results, testCategory, sigValue, operator=c("<"), column= c("adj_P_Val")) {
@@ -309,7 +310,7 @@ InferenceUpsetPlot <- function(Inference.Results, testCategory, sigValue, operat
309310
#Create the upset plot.
310311
rv <- UpSetR::upset(data,sets = testsUsed, sets.bar.color = "#56B4E9",order.by = "freq", empty.intersections = "on")
311312
#rv <- upset(data,point.size=1.1, line.size=0.4,sets = testsUsed, sets.bar.color = "#56B4E9",order.by = "freq", empty.intersections = "on")
312-
print(rv)
313+
print(rv, newpage = FALSE)
313314
invisible();
314315
}
315316

@@ -376,6 +377,7 @@ getEnrichmentsUpset <- function(
376377
#' * Changed `<=` and `>=` to `<` and `>`, respectively, to match app UI
377378
#' * Added tests parameter and respective subset functionality
378379
#' * Removed colsUsed variable and replaced with tests
380+
#' * Set `newpage = FALSE` when printing to avoid blank page
379381
#'
380382
#' @noRd
381383
EnrichmentUpsetPlot <- function(Enrichment.Results, Enrichment.Results.Adjusted, testCategory, annotation, sigValue, operator=c("<"), pValType="nominal", tests=NULL) {
@@ -423,7 +425,7 @@ EnrichmentUpsetPlot <- function(Enrichment.Results, Enrichment.Results.Adjusted,
423425
#Create the upset plot.
424426
rv <- UpSetR::upset(data, sets = tests, sets.bar.color = "#56B4E9",order.by = "freq", empty.intersections = "on")
425427

426-
print(rv)
428+
print(rv, newpage = FALSE)
427429
invisible();
428430
}
429431

0 commit comments

Comments
 (0)