-
Notifications
You must be signed in to change notification settings - Fork 2
/
ui.r
185 lines (166 loc) · 12.3 KB
/
ui.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
library(shiny)
library(dplyr)
library(plotly)
mdata <- read.csv("./data/malaria_data.csv", stringsAsFactors = FALSE)
# Panel for the rworldmap map
shinyUI(navbarPage("Interactive Map of Malaria Deaths and Cases by Country",
tabPanel("Summary",
p(strong("Malaria"),"is the", code("number one"), "infectious disease that kills the most people worldwide every year. Although rates of
infection have decreased over the years from increased prevention and control measures,", code("nearly half"), "the world is still at risk of
malaria. Due to the significance of this infectious disease, we will be working with datasets of reported", span("deaths and cases", style = "color:blue"), "from malaria by
country. The dataset is collected from the", em("World Health Organization (WHO) website"), "and we accessed it through", em("Global Health Observatory"),
"data repository in the WHO website. This data contains number of reported deaths and cases from years", strong("2000"), "to", strong("2014"), "in", code("109"),
"countries all across the region. This project will explore", span("the prevalence of malaria by country, the spread of malaria over time in the regions, and understand the risk factors
associated with a high prevalence rate in a country.", style = "color:blue"), "Someone who is planning to", strong("travel to a certain country"), "would be interested in this information so
he or she can learn the malaria prevalence in the country and therefore plan accordingly. Furthermore, anyone who would simply like to know the", strong("risks and
impact of malaria"), "in that specific country would find this useful.")
),
tabPanel("Interactive Map of Deaths",
titlePanel("Malaria Deaths per Country"),
sidebarLayout(
# User can select what data to show, which year of cases to show
sidebarPanel(
selectInput('deaths', label = 'Select a year',
choices = list("2014 deaths" = "X2014.malaria.deaths",
"2013 deaths" = "X2013.malaria.deaths",
"2012 deaths" = "X2012.malaria.deaths",
"2011 deaths" = "X2011.malaria.deaths",
"2010 deaths" = "X2010.malaria.deaths",
"2009 deaths" = "X2009.malaria.deaths",
"2008 deaths" = "X2008.malaria.deaths",
"2007 deaths" = "X2007.malaria.deaths",
"2006 deaths" = "X2006.malaria.deaths",
"2005 deaths" = "X2005.malaria.deaths",
"2004 deaths" = "X2004.malaria.deaths",
"2003 deaths" = "X2003.malaria.deaths",
"2002 deaths" = "X2002.malaria.deaths",
"2001 deaths" = "X2001.malaria.deaths",
"2000 deaths" = "X2000.malaria.deaths"))
),
# mainPanel
mainPanel(
plotlyOutput('mDeaths'),
br(),
br(),
p("This map shows the malaria deaths per each country in a specific year from 2000-2014
. Hover over a country to show exact number of deaths and more info.")
)
)
),
# Panel for the interactive plotly world map of cases per country
tabPanel("Interactive Map of Cases",
titlePanel("Malaria Cases per Country"),
sidebarLayout(
# User can select what data to show, which year of cases to show
sidebarPanel(
selectInput('cases', label = 'Select a year',
choices = list("2014 cases" = "X2014.malaria.cases",
"2013 cases" = "X2013.malaria.cases",
"2012 cases" = "X2012.malaria.cases",
"2011 cases" = "X2011.malaria.cases",
"2010 cases" = "X2010.malaria.cases",
"2009 cases" = "X2009.malaria.cases",
"2008 cases" = "X2008.malaria.cases",
"2007 cases" = "X2007.malaria.cases",
"2006 cases" = "X2006.malaria.cases",
"2005 cases" = "X2005.malaria.cases",
"2004 cases" = "X2004.malaria.cases",
"2003 cases" = "X2003.malaria.cases",
"2002 cases" = "X2002.malaria.cases",
"2001 cases" = "X2001.malaria.cases",
"2000 cases" = "X2000.malaria.cases"))
),
# mainPanel
mainPanel(
plotlyOutput('mCases'),
br(),
br(),
p("This map shows the malaria cases per each country in a specific year from 2000-2014
. Hover over a country to show exact number of cases and other info.")
)
)
),
# Panel for the interactive plotly scatter plot of change in deaths per country
tabPanel("Scatter Plot of Change in Deaths",
titlePanel("Change in Malaria Deaths Between 2014 and 2000"),
sidebarLayout(
# User can select what data to show by typing in the name of the country
sidebarPanel(
textInput('search', label = "Enter a country name", value = '')
),
# mainPanel
mainPanel(
plotlyOutput('mChange'),
br(),
br(),
p("The chart shows the change in malaria deaths per country from 2000 to 2014.
The size of the circle shows the magnitude of the decrease in deaths over the 14-year period.
Hover over the dot to show the deaths in 2000 followed by the deaths in 2014. For some countries,
the dot will not show up because the WHO data was incomplete (Example: Somalia).")
)
)
),
tabPanel("Dataset of Cases and Deaths by Regions",
sidebarLayout(
# User can select which region data to show
sidebarPanel(
selectInput("regions", label = 'Select region',
choices = list("Africa",
"Asia",
"Europe",
"North America",
"South America",
"Australia")),
radioButtons("type", label = 'Select the report of:', c("deaths", "cases")),
helpText("You can select the region and the type of report to see the dataset of the countries in the selected region")
),
# mainPanel
mainPanel(
tableOutput('mTable')
)
)
),
# tabPanel for bar plot
tabPanel("Bar Graph of Mean Cases/Deaths per Region in 2014",
#
titlePanel("Mean Cases/Deaths per Region in 2014"),
#
sidebarLayout(
# User can select what data to show
sidebarPanel(
selectInput('regionvar', label = 'Select an input...',
choices = list("Mean Deaths" = "mean.deaths",
"Mean Cases" = "mean.cases"))
),
# mainPanel
mainPanel(
plotlyOutput('bar'),
br(),
br(),
p("This chart shows the mean deaths/cases per region of the world in 2014. See the detailed region tab
for more info. Hover over a bar to see the exact means. The WHO does not have data for Malaria cases/deaths
for Europe, however.")
)
)
),
# Panel for the interactive plotly world map of cases/deaths per 1000 people per country in 2014
tabPanel("Interactive Map of Deaths/Cases per 1000",
titlePanel("Malaria Deaths/Cases per 1000 people per Country in 2014"),
sidebarLayout(
# User can select what data to show, which year of cases to show
sidebarPanel(
selectInput('mPer1000var', label = 'Select cases/deaths',
choices = list("2014 cases per 1000" = "malaria.cases.per.1000",
"2014 deaths per 1000" = "malaria.deaths.per.1000"))
),
# mainPanel
mainPanel(
plotlyOutput('mPer1000'),
br(),
br(),
p("This map shows the number of deaths/cases per country per 1000 people in 2014.
Hover over a country to show exact number of cases and other info.")
)
)
)
))