-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
48 lines (42 loc) · 1.04 KB
/
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
48
shinyServer(function(input, output) {
output$star_scatter_plot <- renderPlot({
if (!input$moviestar) {
if (input$regression_line) {
plot <- plot_population_regressionline
} else {
plot <- plot_population
}
} else {
if (input$regression_line) {
plot <- plot_moviestar_regressionline
} else {
plot <- plot_moviestar
}
}
plot
})
output$moviestar_dag <- renderPlot({
if (!input$moviestar) {
dag <- collider_unconditional
} else {
## Control for Movie star
dag <- collider_conditional
}
# ggdag(collider_dag) + theme_dag()
dag
})
output$regression_tbl <- render_gt({
if (!input$moviestar) {
reg_output <- reg_population
} else {
reg_output <- reg_moviestar
}
reg_output
})
# Code to keep app alive after timeout (Heroku timeout after ca. 55 seconds)
# autoInvalidate <- reactiveTimer(10000)
# observe({
# autoInvalidate()
# cat(".")
# })
})