मैं अपने ऐप में विभिन्न प्लॉट / आउटपुट द्वारा उपयोग किए जा रहे डेटा के अपडेट को ट्रिगर करने के लिए दो अलग-अलग ईवेंट चाहता हूं। एक बटन पर क्लिक किया जा रहा है ( 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
}
})
लेकिन अगर-और क्लॉज काम नहीं करता है
Error in mainplot.click$click | input$spec_button :
operations are possible only for numeric, logical or complex types
-> क्या कुछ प्रकार के एक्शन-कॉम्बिनेटर फ़ंक्शन हैं जो मैं mainplot.click$click | input$spec_button
क्लॉज के लिए उपयोग कर सकता हूं ?