-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
47 lines (38 loc) · 944 Bytes
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
shinyServer(function(input, output) {
output$age_scatter_plot <- renderPlot({
if (!input$age) {
plot <- plot_unconditional
if (input$regression_line) {
plot <- plot_unconditional_regressionline
}
} else {
plot <- plot_conditional
if (input$regression_line) {
plot <- plot_conditional_regressionline
}
}
plot
})
output$age_dag <- renderPlot({
if (!input$age) {
dag <- dag_unconditional
} else {
dag <- dag_conditional
}
dag
})
output$regression_tbl <- render_gt({
if (!input$age) {
reg_output <- reg_unconditional
} else {
reg_output <- reg_conditional
}
reg_output
})
# Code to keep app alive after timeout (Heroku timeout after ca. 55 seconds)
# autoInvalidate <- reactiveTimer(10000)
# observe({
# autoInvalidate()
# cat(".")
# })
})