为了账号安全,请及时绑定邮箱和手机立即绑定

如何在一个闪亮事件中监听多个事件表达式

如何在一个闪亮事件中监听多个事件表达式

回首忆惘然 2019-11-30 14:20:03
我想要两个不同的事件来触发我的应用程序中各种绘图/输出所使用的数据的更新。一个是被单击的按钮(input$spec_button),另一个是被单击的点上的点(mainplot.click$click)。基本上,我想同时列出两者,但是我不确定如何编写代码。这是我现在所拥有的:在server.R中:data <- eventReactive({mainplot.click$click | input$spec_button}, {    if(input$spec_button){      # get data relevant to the button    } else {      # get data relevant to the point clicked    }  })但是if-else子句不起作用Error in mainplot.click$click | input$spec_button :   operations are possible only for numeric, logical or complex types->我可以为mainplot.click$click | input$spec_button子句使用某种动作组合功能吗?
查看完整描述

3 回答

?
交互式爱情

TA贡献1712条经验 获得超3个赞

我已经通过创建反应式对象并将其用于事件更改表达式中来解决了此问题。如下:


xxchange <- reactive({

paste(input$filter , input$term)

})


output$mypotput <- eventReactive( xxchange(), {

...

...

...

} )


查看完整回答
反对 回复 2019-11-30
  • 3 回答
  • 0 关注
  • 631 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信