В Shiny - flexdashboard я использую observeEvent
с ignoreInit=TRUE
в двух случаях. Один с eventExpr
, который является входом напрямую, и другой, где он заключен в eventReactive
. Первый observeEvent
ниже (соответствует вводу react
) ничего не печатает при запуске приложения. Второй (соответствующий вводу input
) делает. У обоих есть ignoreInit=TRUE
. Есть ли этому объяснение? Я ничего не нашел.
---
title: "observeEvent ignoreInit"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
```
Column {data-width=350}
-----------------------------------------------------------------------
### A
```{r}
checkboxInput(inputId = "input", label = "input")
checkboxInput(inputId = "react", label = "react")
reactBoxreac = eventReactive(input$react, {input$react})
observeEvent(reactBoxreac(), {
print("observeEvent of react checkBox is executed\n")
}, ignoreInit=TRUE)
observeEvent(input$input, {
print("observeEvent of input checkBox is executed\n")
}, ignoreInit=TRUE)
```