Do you need the results ouf out1 and out2 somewhere else or is this just to create out3.
In this case you can combine everything, instead creating a chain of reactives.
out3 <- reactive({
out1 = raw_input()[[1]]**2
out2= out1 * 5
out3= out1+out2
return(out3)
})
then you can repeat this for the 3 tabs:
out3_tab1 <- reactive({
out1 = raw_input()[[1]]**2
out2= out1 * 5
out3= out1+out2
return(out3)
})
out3_tab2 <- reactive({
out1 = raw_input()[[2]]**2
out2= out1 * 5
out3= out1+out2
return(out3)
})
As this would be an unnecessary duplication of code, better write this into a function that can be used multiple times.
calculate_out3 = function(data, tab {
out1 = data[[tab]]**2
out2= out1 * 5
out3= out1+out2
return(out3)
}
and call this in the reactive environment:
out3_tab1 = reactive({
calculate_out3(raw_input(), 1)
})
out3_tab2 = reactive({
calculate_out3(raw_input(), 2)
})
Something like that.
But with this solution your need to have 3 download buttons as well, one for each output.