Skip to contents

Output and render functions for using upset() within Shiny applications and interactive R Markdown / Quarto documents.

Usage

upsetOutput(output_id, width = "100%", height = "520px")

renderUpset(expr, env = parent.frame(), quoted = FALSE)

Arguments

output_id

Output variable to read from.

width, height

Element size, passed to htmlwidgets::shinyWidgetOutput().

expr

An expression that generates an upset() widget.

env

The environment in which to evaluate expr.

quoted

Is expr already quoted? Defaults to FALSE.

Value

upsetOutput() returns a Shiny output UI element; renderUpset() returns a Shiny render function.

Examples

if (interactive() && requireNamespace("shiny", quietly = TRUE)) {
  sets <- list(A = c("x", "y", "z"), B = c("y", "z", "w"))
  ui <- fluidPage(upsetOutput("us"))
  server <- function(input, output) {
    output$us <- renderUpset(upset(upset_intersections(sets)))
  }
  shinyApp(ui, server)
}