reactive(x, env = parent.frame(), quoted = FALSE, label = NULL, domain = getDefaultReactiveDomain(), ..stacktraceon = TRUE)
is.reactive(x)
reactive
, an expression (quoted or unquoted). For
is.reactive
, an object to test.FALSE
.
This is useful when you want to use an expression that is stored in a
variable; to do so, it must be quoted with quote()
.stacktrace
.See the Shiny tutorial for more information about reactive expressions.
values <- reactiveValues(A=1)
reactiveB <- reactive({
values$A + 1
})
# Can use quoted expressions
reactiveC <- reactive(quote({ values$A + 2 }), quoted = TRUE)
# To store expressions for later conversion to reactive, use quote()
expr_q <- quote({ values$A + 3 })
reactiveD <- reactive(expr_q, quoted = TRUE)
# View the values from the R console with isolate()
isolate(reactiveB())
isolate(reactiveC())
isolate(reactiveD())
Run the code above in your browser using DataLab