forked from info-201a-au20/airbnb-covid-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
356 lines (313 loc) · 13.9 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
library(shiny)
library(shinythemes)
library(shinyWidgets)
library(leaflet)
library(dplyr)
library(wordcloud2)
source("scripts/table_summary.R")
source("scripts/general_info.R")
source("scripts/table_summary.R")
country_picker <- selectInput(
inputId = "current_country",
label = "Choose Country/City",
choices = c(
"Seattle",
"San Francisco",
"New York",
"Tokyo",
"Mexico City",
"Melbourne",
"London",
"Cape Town"
),
selected = "Seattle"
)
country_picker_chart <- selectInput(
inputId = "current_chart_country",
label = "Choose Country/City",
choices = c(
"Seattle",
"San Francisco",
"New York",
"Tokyo",
"Mexico City",
"Melbourne",
"London",
"Cape Town"
),
selected = "Seattle"
)
country_picker_boxplot <- selectInput(
inputId = "current_boxplot_country",
label = "Choose Country/City",
choices = c(
"Seattle",
"San Francisco",
"New York",
"Tokyo",
"Mexico City",
"Melbourne",
"London",
"Cape Town"
),
selected = "Seattle"
)
filter_map_judge <- selectInput(
inputId = "filter_yes_or_no",
label = "Filter Map?",
choices = c("Yes", "No"),
selected = "No"
)
filter_chart_judge <- selectInput(
inputId = "filter_chart_yes_or_no",
label = "Filter Chart?",
choices = c("Yes", "No"),
selected = "No"
)
filter_boxplot_judge <- selectInput(
inputId = "filter_boxplot_yes_or_no",
label = "Filter Box Plot?",
choices = c("Yes", "No"),
selected = "No"
)
filter_cloud_judge <- selectInput(
inputId = "filter_cloud_yes_or_no",
label = "Filter Cloud (Listing)?",
choices = c("Yes", "No"),
selected = "No"
)
filter_cloud_reviews_judge <- selectInput(
inputId = "filter_cloud_reviews_yes_or_no",
label = "Filter Cloud (Review)?",
choices = c("Yes", "No"),
selected = "No"
)
get_summary_table <- selectInput(
inputId = "group_by_type_summary_table",
label = "Select",
choices = c(
"analyze last 30days usecases group by room_type",
"analyze last 30days city name group by host_neighbourhood",
"analyze last 12 months group by room_type",
"analyze last 12 months city by host_neighbourhood"
),
selected = "analyze last 12 months city by host_neighbourhood"
)
country_picker_wordcloud <- selectInput(
inputId = "current_cloud_country",
label = "Choose Country/City",
choices = c(
"Seattle",
"San Francisco",
"New York",
"Tokyo",
"Mexico City",
"Melbourne",
"London",
"Cape Town"
),
selected = "Seattle"
)
country_picker_wordcloud_reviews <- selectInput(
inputId = "current_cloud_reviews_country",
label = "Choose Country/City",
choices = c(
"Seattle",
"San Francisco",
"New York",
"Tokyo",
"Mexico City",
"Melbourne",
"London",
"Cape Town"
),
selected = "Seattle"
)
background_image <-
setBackgroundImage(src = "https://news.airbnb.com/wp-content/uploads/sites/4/2020/04/Airbnb_Peru_Skylodge.jpg")
ui <- shinyUI(fluidPage(
navbarPage(
theme = shinytheme("superhero"),
title = "Airbnb World Situation during COVID-19",
# TL;DL
tabPanel(
background_image,
title = "HOME",
sidebarLayout(
sidebarPanel(
tags$h3("TL;Dl"),
tags$p(
"- The COVID-19 pandemic led to a sharp drop in Airbnb users,
and the company was on the verge of a cash shortage due to the cancellation process."
),
p(
"- Simultaneously with the layoffs, the company raised funds and changed its platform concept
from short term rental to mid-long term rental."
),
p(
"- As remote work becomes more common for keeping social distancing,
Airbnb users have seen a surge in its use as a workspace,
with mid-July marking the first time in four months that more than one million
room bookings were made. However, it is unsure that it will last and be sustainable."
),
tags$h3("Introduction"),
p(
"In mid-July, the company recorded more than 1 million overnight bookings for the first time in four months,
and such bookings were characterized by a high number of non-urban bookings,
according to the Airbnb offiial fiscal year report.
A new form of Airbnb is beginning to emerge with social distance in mind.
Up until now, Airbnb has typically been a user behavior of 'I'm going to use Airbnb because I'm going to visit a city called ~.'
But at this moment, it seems to be more of a reverse flow of
'I want to stay in this Airbnb house or environment,
so I'm going to visit a city called ~.' This is understandable and this could be a next strategy for Airbnb as they use term 'GO NEAR' on their platform
Especially, it is interesting to explore their current user data since they are about to go public! (Congrats!) ."
),
p(
"Use filter as you with. Select 'Yes' if you would like to see filtered Airbnb listings/reviews dataset, frequent used words for
listing/review page.
The filter dataset only shows the properties that user commented in the review with words such as 'COVID',
which we can asuume the place was used during the pandemic for specific reason.
The data is between January 1, 2020 to October 10."
),
tags$h3("Word Cloud <Listings>"),
filter_cloud_judge,
country_picker_wordcloud,
tags$h3("Word Cloud <Reviews>"),
country_picker_wordcloud_reviews
),
mainPanel(
wordcloud2Output(outputId = "showCloud"),
p(""),
wordcloud2Output(outputId = "showCloudReviews"),
p(""),
tags$h2("Key Question"),
tags$blockquote(
"My question is whether they should continue with the concept of medium- to long-term stay
concept in 2021 and beyond, should the pandemic show a recovery trend.
At this stage, as mentioned above, retention rates are higher than in the immediate aftermath
of the pandemic.
This is because people's lifestyles are changing from urban dwellings and office work to
a work-from-home (work-from-anywhere) lifestyle.
This analysis will examine the dataset from the Inside Airbnb, which is an independent, non-commercial set of tools and data that allows to explore how Airbnb is being used in cities around the world.
The analysis will try to find user's behavior during the pandemic (After January 2020 to October 2020) and what their demand has been changing.
"
),
)
)
),
tabPanel(title = "Map",
div(
class = "outer",
tags$head(includeCSS("styles.css")),
fillPage(
leafletOutput(
outputId = "map",
width = "100%",
height = "100%"
),
absolutePanel(
id = "controls",
class = "panel panel-default",
fixed = TRUE,
draggable = FALSE,
top = 60,
left = "auto",
right = 20,
bottom = "auto",
width = "auto",
height = "auto",
tags$h3("Airbnb Listings"),
p(
"Filter map as you with. Select 'Yes' if you would like to see filtered Airbnb listings map,
otherwise select 'No'. The property dataset was filtered, and the filter conditions used the following words
in the review comments left by users after January 1, 2020."
),
p(
"- 'COVID|COVID-19|coronavirus|covid|virus|pandemic|remote|remote work|workation|staycation'"
),
p(
"This filtering allows us to hypothesize that the facilities were used to refresh the pandemic, remote work, etc.
The colors of the graphs are color-coded by the minimum number of nights set for each facility. "
),
filter_map_judge,
country_picker
)
)
)),
tabPanel(title = "Cap vs Price vs Room",
sidebarLayout(
sidebarPanel(
tags$h3("Cap vs Price vs Room"),
p(
"Filter chart as you with. Select 'Yes' if you would like to use filtered Airbnb listings dataset,
otherwise select 'No'. These charts show the price per night on the x-axis and the maximum number of people that can stay at the facility on the y-axis.
One chart is sourced from a data frame for the past 12 months but utilizes a dataset of guest reviews filtered by relevant terms such as 'COVID, COVID-19, and Remote Work'.
This helps to find Airbnb properties that have been used for specific purposes during the pandemic."
),
filter_chart_judge,
country_picker_chart
),
mainPanel(plotOutput("priceChart"))
)),
tabPanel(title = "Price Precise Data",
sidebarLayout(
sidebarPanel(
tags$h3("Price and Room Type Relationships"),
p(
"Filter map as you with. Select 'Yes' if you would like to use filtered Airbnb listings dataset,
otherwise select 'No'.Chart 2 shows the average, minimum and maximum prices for each room type.
The overall price averages are also represented in purple."
),
filter_boxplot_judge,
country_picker_boxplot
),
mainPanel(plotOutput("priceRoomBoxPlot"))
)),
tabPanel(title = "Go Deeper",
sidebarLayout(
sidebarPanel(
tags$h3("Quick Takeaways"),
p(
"When you look at the map with filtered data, it is clear that most of property requires guest to stay at least 20-30 days. It is understandable since Airbnb
currently encourages host to open their house as long term use, monthly useage."
),
p(
"Surprisingly, we don't see major shift in average price for entire country/list between filter data and raw data.
However, most of the filtered data shows only Entire Home and hotels and shared houses are not even appeard as box plot, i.e, no data.
For example in Cape Town, hotel room, private room, shared room were used a lot, but only entire home and private room are used in filtered data."
),
p(
"- We can see that the demand is mainly concentrated in facilities that can accommodate up to four people, up to a maximum of $200 per night.
Conversely, withouf filter, we can see that facilities ranging from $400 to $500 per night are quite common,
and demand is concentrated in facilities that accommodate between 4 and 8 people at most. It should be at least transparent that
there has been a shift in demand for Airbnb, in the wake of the pandemic,
especially for family vacation use and as a remote working place.
In that sense, facilities for 12 or more people are only used few times, and
Airbnb owners are likely to suffer from a demand that is unlikely to return. (Check <Cap vs Price vs Room> section)"
),
tags$h3("Company Overview"),
p(
"Airbnb is a U.S.-based startup in the private accommodation business and one of the world's largest marketplaces, with over 7 million places to stay and tens of thousands of original experiences,
all provided by local hosts. Airbnb, which helps people achieve economic independence, has helped millions of hospitality entrepreneurs worldwide work on their spare rooms and
the things they love to do and have helped promote communities through tourism. Airbnb is a company that connects people around the world and fosters community and trust."
),
tags$h3("Contact"),
p("Contact me via Github or Twitter!"),
p(
"Me => Taishi Masubuchi | Blockchain Researcher @ Quantstamp inc., Flutter/Dart, Solidity Dev based in US and Japan"
),
p(a("Github", href = "https://github.com/huskyjp")),
p(a("Twitter", href = "https://twitter.com/taiseaocean"))
),
mainPanel(
HTML(
'<img src = "https://blog.adioma.com/wp-content/uploads/2016/07/how-airbnb-started-infographic.png">'
),
tags$h2("Original Airbnb Concept - AirBed & Breakfast"),
p(
a("Image Source: How Airbnb Stared - Infographic", href = "https://blog.adioma.com/how-airbnb-started-infographic/")
)
)
))
)
))