-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
185 lines (177 loc) · 6.03 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(colourpicker)
library(shinydashboard)
library(rsconnect)
countries <- list("Canada" = "Canada",
"U.S.A" = "U.S.A",
"Argentina" = "Argentina",
"Brazil" = "Brazil",
"Mexico" = "Mexico",
"Austria" = "Austria",
"Belgium" = "Belgium",
"Denmark" = "Denmark",
"Finland" = "Finland",
"France" = "France",
"Germany" = "Germany",
"Greece" = "Greece",
"Ireland" = "Ireland",
"Italy" = "Italy",
"Netherlands" = "Netherlands",
"Norway" = "Norway",
"Portugal" = "Portugal",
"Spain" = "Spain",
"Sweden" = "Sweden",
"Switzerland" = "Switzerland",
"U.K." = "U.K.",
"Czech Rep." = "Czech Rep.",
"Hungary" = "Hungary",
"Kazakhstan" = "Kazakhstan",
"Poland" = "Poland",
"Russian Fed" = "Russian Fed",
"Ukraine" = "Ukraine",
"Egypt" = "Egypt",
"Kenya" = "Kenya",
"Mauritius" = "Mauritius",
"Nigeria" = "Nigeria",
"South Africa" = "South Africa",
"Sudan" = "Sudan",
"Tanzania" = "Tanzania",
"Bahrain" = "Bahrain",
"Iraq" = "Iraq",
"Israel" = "Israel",
"Oman" = "Oman",
"Saudi Arabia" = "Saudi Arabia",
"Turkey" = "Turkey",
"U.A.E." = "U.A.E.",
"Yemen Arab Rep." = "Yemen Arab Rep.",
"Afghanistan" = "Afghanistan",
"Bangladesh" = "Bangladesh",
"Bhutan" = "Bhutan",
"Iran" = "Iran",
"Maldives" = "Maldives",
"Nepal" = "Nepal",
"Pakistan" = "Pakistan",
"Sri Lanka" = "Sri Lanka",
"Indonesia" = "Indonesia",
"Malaysia" = "Malaysia",
"Myanmar" = "Myanmar",
"Philippines" = "Philippines",
"Singapore" = "Singapore",
"Thailand" = "Thailand",
"Vietnam" = "Vietnam",
"China" = "China",
"Japan" = "Japan",
"Rep. of Korea" = "Rep. of Korea",
"Taiwan" = "Taiwan",
"Australia" = "Australia",
"New Zealand" = "New Zealand")
ui_header <- dashboardHeader(title = "India Tourism")
ui_sidebar <- dashboardSidebar(
sidebarMenu(
id = "sidebar_menu",
menuItem("General View", tabName = "First", icon = icon("star")),
menuItem("Detail View", tabName = "Second", icon = icon("dashboard")),
menuItem("Comparisons View", tabName = "Thrid", icon = icon("cloud"))
))
ui_body <- dashboardBody(
tabItems(
tabItem(
tabName = "First",
fluidPage(
titlePanel(
h2("India Tourism Overview")
),
mainPanel(
width = 12,
h4(
"This section describes the evolution of visitors to India through years."),
box(width = 12,
solidHeader = TRUE,
plotOutput("generalR")
),
h4(
"The second design is based on presenting the incomes obtained from tourism per year and its relationship with the number of visitors."
),
box(width = 12,
solidHeader = TRUE,
plotOutput("scatterGeneral")
),
h4(
"Finally, the correlation between visitors and incomes quarterly is shown."
),
box(width = 12,
solidHeader = TRUE,
plotOutput("thirdGraph")
),
)
)
),
tabItem(
tabName = "Second",
fluidPage(
titlePanel(
h2("Yearly analysis of tourism")
),
mainPanel(
width = 12,
h4("Analysis of the important statistics regarding airport visitors, visitor's nationalities and age groups."),
box(width = 12,
sliderInput("siyear", "Years:",
min = 2014, max = 2020,
value = 2014, round = 1, sep = "")
),
box(width = 12,
solidHeader = TRUE,
plotOutput("stackedAir")
),
fluidRow(
box(width = 3,
radioButtons(
"categorical_choice",
h4("Select variable to analyze"),
choices = list(
"Age Groups",
"Continent",
"Sex",
"Transport mean"
),
selected = "Age Groups")
),
box(width = 9,
solidHeader = TRUE,
plotOutput("lineAge")
),
),
))
),
tabItem(
tabName = "Thrid",
fluidPage(
titlePanel(
h2("Tourist's nationalities comparisons")
),
mainPanel(
width = 12,
h4("This section highlights the comparison between visitor's nationalities regarding the frequency over time."),
box(width = 12,
selectInput(inputId = "country1",
label = "Select first country",
choices = countries,
selected = "Canada"),
selectInput(inputId = "country2",
label = "Select second country",
choices = countries,
selected = "U.S.A")
),
),
),
box(width = 12,
solidHeader = TRUE,
plotOutput("linePlot"),
click = "plot_click",
dblclick = dblclickOpts(id = "plot_dblclick"),
),
)
)
)
ui <- dashboardPage(skin = "green", ui_header, ui_sidebar, ui_body)