Skip to contents

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

Usage

bioprofileOutput(output_id, width = "100%", height = "380px")

renderBioprofile(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 a bioprofile() widget.

env

The environment in which to evaluate expr.

quoted

Is expr already quoted? Defaults to FALSE.

Value

bioprofileOutput() returns a Shiny output UI element; renderBioprofile() returns a Shiny render function.

Examples

if (interactive() && requireNamespace("shiny", quietly = TRUE)) {
  ui <- fluidPage(bioprofileOutput("bp"))
  server <- function(input, output) {
    output$bp <- renderBioprofile({
      bioprofile(context = c("C>A", "C>G", "C>T"),
                 value = c(0.3, 0.5, 0.2))
    })
  }
  shinyApp(ui, server)
}