Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shiny 同一事件中的多个闪亮对象_Shiny_Shiny Reactivity - Fatal编程技术网

Shiny 同一事件中的多个闪亮对象

Shiny 同一事件中的多个闪亮对象,shiny,shiny-reactivity,Shiny,Shiny Reactivity,我有一个反应对象的列表,我用如下内容定义: myReactiveList <- reactive({ object1 <- some calculation depending on user inputs object2 <- some calculation depending object 1 and on other user inputs # put both in reactive list with: list( reactiveObject1 &l

我有一个反应对象的列表,我用如下内容定义:

myReactiveList <- reactive({

object1 <- some calculation depending on user inputs

object2 <- some calculation depending object 1 and on other user inputs

# put both in reactive list with:
list(
    reactiveObject1 <- reactive({object1}) 
    reactiveObject2 <- reactive({object2}) 
    )
})


myReactiveList您可以将
object1
object2
包装在一个列表中,然后分别使用
myReactiveList()[[1]]
myReactiveList()[[2]]
调用它们-

myReactiveList <- eventReactive(input$go, {
  object1 <- some calculation depending on user inputs

  object2 <- some calculation depending object 1 and on other user inputs

  # put both in a list
  list(object1, object2)
})
myReactiveList