Skip to contents

Creates a render function for inline outputs that automatically formats numeric values appropriately (integers without decimals, other numbers to one decimal place).

Usage

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

Arguments

expr

Expression to evaluate

env

Environment to evaluate in

quoted

Whether the expression is quoted

Value

A Shiny render function that creates inline output elements

Examples

library(shiny)

ui <- fluidPage(
  p("The result is", inlineOutput("result"))
)

server <- function(input, output) {
  output$result <- renderInline({
    # Will be formatted to one decimal place
    42.123
  })
}

if (interactive()) {
 shinyApp(ui, server)
}