Usage
observeEvent(eventExpr, handlerExpr, event.env = parent.frame(), event.quoted = FALSE, handler.env = parent.frame(), handler.quoted = FALSE, label = NULL, suspended = FALSE, priority = 0, domain = getDefaultReactiveDomain(), autoDestroy = TRUE, ignoreNULL = TRUE)
eventReactive(eventExpr, valueExpr, event.env = parent.frame(), event.quoted = FALSE, value.env = parent.frame(), value.quoted = FALSE, label = NULL, domain = getDefaultReactiveDomain(), ignoreNULL = TRUE)
Arguments
eventExpr
A (quoted or unquoted) expression that represents the event;
this can be a simple reactive value like input$click
, a call to a
reactive expression like dataset()
, or even a complex expression
inside curly braces
handlerExpr
The expression to call whenever eventExpr
is
invalidated. This should be a side-effect-producing action (the return
value will be ignored). It will be executed within an isolate
scope. event.env
The parent environment for eventExpr
. By default,
this is the calling environment.
event.quoted
Is the eventExpr
expression quoted? By default,
this is 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()
.
handler.env
The parent environment for handlerExpr
. By default,
this is the calling environment.
handler.quoted
Is the handlerExpr
expression quoted? By
default, this is 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()
.
label
A label for the observer or reactive, useful for debugging.
suspended
If TRUE
, start the observer in a suspended state. If
FALSE
(the default), start in a non-suspended state.
priority
An integer or numeric that controls the priority with which
this observer should be executed. An observer with a given priority level
will always execute sooner than all observers with a lower priority level.
Positive, negative, and zero values are allowed.
autoDestroy
If TRUE
(the default), the observer will be
automatically destroyed when its domain (if any) ends.
ignoreNULL
Whether the action should be triggered (or value
calculated, in the case of eventReactive
) when the input is
NULL
. See Details.
valueExpr
The expression that produces the return value of the
eventReactive
. It will be executed within an isolate
scope. value.env
The parent environment for valueExpr
. By default,
this is the calling environment.
value.quoted
Is the valueExpr
expression quoted? By default,
this is 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()
.