输入按钮在我闪亮的应用程序中不起作用

Input button does not work in my shiny app

我创建了一个闪亮的应用程序。但是输入按钮没有反应。 这是代码的快照:

服务器:

  A<-reactive({
    x<-input$RunModel
    quit()##Their is another function here, i wrote quit() just for ilustration
  })

HTML:

    <INPUT style="background-color:#143d4d;color:white;" onclick="newDoc(this.value)" TYPE="button" id="RunModel" class="btn btn-primary" VALUE="Run Model"/>

但不幸的是这个按钮不是反应性的。我在网上搜索了一下,发现它应该可以工作。发生什么事了?

我知道怎么做了。
使用 observeEvent 方法。这是代码的快照:

  observeEvent(input$RunModel,label ="Write a label for debugging",function() {
   quit()
  })

现在,当我单击 'RunModel' 按钮时,它将激活 observeEvent。 并退出应用程序。

你的反应式问题是,你没有 returning 任何 value.When 你按下你的应用程序的 "input" 按钮,它必须 returning 一些值被显示。在反应的 return 中给出该值 Sahring 的一部分 server.r:

contentInput <- reactive({ 

write your Logic/Program

return(xyz)
 })

output$content <- renderGvis({
 temp <- contentInput
  gvisTable(tmp)
 })