input
从闪亮的。但是为了测试这些函数,我需要在没有Shiny的情况下运行它们。所以我想做这样的事。
---
title: "My report that prints `input` variable in both reactive and static format"
# runtime: shiny # I want to be able programmatically to see when Shiny is running and when NOT
---
```{r}
library(shiny)
input0 <- list()
input0$typedDate <- "6/08/1935"
if (!is.shinyRunning()) {
print("Shiny is Not Running")
input <- input0
} else {
textInput("typedDate", "Enter Date:", "6 jul 1935")
}
renderPrint(input$typedDate)
注意,我试过用
if (interactive())