-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.R
More file actions
54 lines (44 loc) · 1.44 KB
/
server.R
File metadata and controls
54 lines (44 loc) · 1.44 KB
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
49
50
51
52
53
54
# Colomaranian FinalProject
# Server
library(shiny)
library(ggplot2)
our.server <- function(input, output) {
output$dropdown1 <- renderUI({
source("Cholera.R")
selectInput("years1", "Select Year:", cholera_years)
})
output$Cholera_plot <- renderPlot({
source("Cholera.R")
if(input$radio1 == "Reported Deaths") {deaths_cholera_world(input$years1)}
else{cases_cholera_world(input$years1)}
})
output$dropdown2 <- renderUI({
source("Malaria.R")
selectInput("years2", "Select Year:", years_maralia)
})
output$Malaria_plot <- renderPlot({
source("Malaria.R")
if(input$radio2 == "Reported Deaths") {make_map_death_malaria(input$years2)}
else{make_map_case_malaria(input$years2)}
})
output$dropdown3 <- renderUI({
source("HIV.R")
if(input$radio3 == "Reported Deaths") {selectInput("years3", "Select Year:", death_years)}
else{selectInput("years3", "Select Year:", cases_years)}
})
output$HIV_plot <- renderPlot({
source("HIV.R")
if(input$radio3 == "Reported Deaths") {hiv_death_map(input$years3)}
else{hiv_cases_map(input$years3)}
})
output$dropdown4 <- renderUI({
source("TB.R")
selectInput("years4", "Select Year:", list_years)
})
output$TB_plot <- renderPlot({
source("TB.R")
if(input$radio4 == "New Patient Success Rate") {make_new_treatments_map(input$years4)}
else{make_previously_treated_map(input$years4)}
})
}
shinyServer(our.server)