【问题标题】:Call to reactive expression doesn't return - R Shiny调用反应式表达式不返回 - R Shiny
【发布时间】:2017-10-19 06:57:55
【问题描述】:

我似乎对 d() 的调用没有返回任何内容,并且当应用程序启动并执行 renderText 中的代码时它会永远持续下去。为什么这样?

library(shiny)
ui <- fluidPage(
  actionButton("but","Click"),
  textOutput("ui_out")
)

server <- function(input,output) {
  d <- eventReactive(input$but, {
    100
  })
  output$ui_out <- renderText({
    print("in")
    d()
    print("out")
  })
}

shinyApp(ui=ui,server=server)

【问题讨论】:

  • 你想同时打印“in”和“out”,还是调试代码?
  • 只是调试代码
  • 如果你删除它们,它对我有用
  • 我删除了它们,但我想看到的是按钮 + 文本 100。它只是按钮
  • shiny 中几乎所有函数中的最后一个参数应该是您要返回的对象,在这里您要返回 print("out")

标签: r shiny


【解决方案1】:

答案是here,更具体地说是here。 这不是永远持续下去。这是一个无声的错误。 解决方案是使用ignoreNULL = FALSE。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-27
    • 2015-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多