render_info_value | R Documentation |
Server render function for info value
render_info_value(
expr,
env = parent.frame(),
quoted = FALSE,
sep = " ",
add_name = TRUE
)
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 |
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.
Shiny render function to be saved as an element of output.
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)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.