render_info_value: Server render function for info value

Description Usage Arguments Details Value Examples

View source: R/value.R

Description

Server render function for info value

Usage

1
2
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.

Value

Shiny render function to be saved as an element of output.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)
}
}

shiny.info documentation built on March 23, 2020, 5:07 p.m.