Server render function for info value
Usage
render_info_value(
expr,
env = parent.frame(),
quoted = FALSE,
sep = " ",
add_name = TRUE
)
Arguments
- expr
value to render
- env
The environment in which to evaluate expr. Default parent.frame()
- quoted
Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable. Default FALSE
- sep
A separator passed to cat to be appended after each element.
- add_name
Should expression name be added. Default TRUE
Details
If you want to use it with toggle_info(), you have to add outputOptions(output, [info value id], suspendWhenHidden = FALSE) to force rendering when the value is hidden.
Examples
if(interactive()) {
library(shiny)
library(shiny.info)
ui <- fluidPage(
info_value("value_to_display")
)
server <- function(input, output, session) {
test_reactive <- reactiveVal("some value")
output$value_to_display <- render_info_value(expr = test_reactive())
# next line is required to work with toggle_info()
outputOptions(output, "value_to_display", suspendWhenHidden = FALSE)
}
}