how to refer two data frames from one reactive function in shiny

Viewed 1026

I have following reactive function in server.r

 test <- reactive({ 

 test_1
 test_2

})

output$table1 <- renderTable({

 test_1
})

output$table2 <- renderTable({

 test_2
})

I want to refer test_1 & test_2 from one reactive function to two different output tables.

How can I achieve above ?

3 Answers

Have one function, but return:

list(df1=test_1, df2=test_2)

Then refer to these in your your other functions

test()$df1
test()$df2

Don't forget the parenthesis before the $

Related