• 一、動機與分析目的
  • 二、資料集描述
  • 三、前置作業
    • 資料取得及套件載入
    • 安裝所需 Packages
    • 載入所需 Packages與資料
  • 四、整體分析
    • I. 日期折線圖
      • 討論文章數最多的10天
      • 繪製日期折線圖
      • 找出討論聲量高的議題
    • II. 文字雲
      • 詞頻最高的前二十名
      • 確診首例出現前的文字雲
      • 確診首例出現後的文字雲
    • III. 長條圖
      • 疫情爆發前後出現詞彙的差別
    • IV. 情緒分析
      • 確診首例出現之前的情緒
      • 10月10日當天的「負面」文章
      • 10月10日前後的「負面」文章
      • 外送事故文章的時間點
      • 其他時間點的情緒分析
      • 確診首例出現之後的情緒
      • 大事件:雲林客戶狂放棄訂單
      • 2月12日前一天的文章
      • 2月12日後一天的文章
    • V. TF-IDF
      • 疫情爆發前期(1/21前)
      • 疫情爆發後期(1/21後)
    • VI. 詞彙相關性分析
      • 整體相關性分析
      • 疫情爆發前期(1/21前)相關性分析
      • 疫情爆發後期(1/21後)相關性分析
    • VII. 整體分析小結
  • 五、Foodpanda和Ubereats分析
    • I. 聲量比較
      • UberEats
        • 1.UberEats聲量趨勢圖
        • 2.前五多的文章日期
      • Foodpanda
        • 1.Foodpanda聲量趨勢圖
        • 2.前五多的文章日期
    • II. 情緒比較
      • UberEats
        • 1.情緒趨勢圖
        • 2.正面情緒高峰
        • 3.負面情緒高峰
        • 4.與疫情相關的文章
      • Foodpanda
        • 1.情緒趨勢圖
        • 2.正面情緒高峰
        • 3.負面情緒高峰
        • 4.與疫情相關的文章
    • III. 兩大平台交叉比較
      • 1.正面情緒趨勢
      • 2.負情緒趨勢
    • IV. 兩大平台分析小結
  • 六、總結

第15組組員:龔雪燕、鄭宇翔、鄭子婷、余任濤

一、動機與分析目的

  2020年1月21日,臺灣出現第一例境外移入確診病例,武漢肺炎(COVID-19)的議題討論聲量逐漸興起,不論是口罩酒精、旅遊觀光還是居家活動等議題也隨之竄起,其中「外送平台」的使用更是大幅提高,據平台業者統計,2月外送單量較1月大幅成長5成,更較去年同期成長4倍,近期政府也開始推出紓困政策,各大外送平台祭出各種因應疫情的相關措施
  除此之外,外送員的安全、防疫的措施是否充足和外送平台是否能為餐飲業者帶來轉機,都是大家非常關心的議題,因此我們想從PTT討論平台觀察在武漢肺炎爆發前後,外送平台的討論聲量和情緒有沒有特別的變化,並深入分析台灣兩大外送平台龍頭「Foodpanda」和「UberEats」的相關討論文章中民眾的情緒表現是否有差異,以此來審視民眾對兩大外送平台對武漢肺炎處理辦法的態度。

二、資料集描述

資料由中山大學管理學院文字分析平台取得,在平台資料輸出區塊選擇「文章+詞彙+詞頻」選項,即可取得相同格式之csv檔案
本資料為2019/09/01 ~ 2020/04/23 PTT八卦版之資料,透過文字分析平台檢索「外送平台」、「Foodpanda」、「UberEats」等相關關鍵字,共搜尋到2311篇文章。

三、前置作業

資料取得及套件載入

## [1] ""

安裝所需 Packages

packages = c("readr", "dplyr", "stringr", "jiebaR", "tidytext", "NLP", "readr", "tidyr", "ggplot2", "ggraph", "igraph", "scales", "reshape2", "widyr", "wordcloud")
existing = as.character(installed.packages()[,1])
for(pkg in packages[!(packages %in% existing)]) install.packages(pkg)

載入所需 Packages與資料

require(dplyr)
require(ggplot2)
require(data.table)
require(scales)
require(wordcloud2)
library(wordcloud)
require(readr)
require(stringr)
require(jiebaR)
require(tidytext)
require(NLP)
require(tidyr)
require(ggraph)
require(igraph)
require(reshape2)
require(widyr)

# 載入自平台下載下來的資料
order <- fread("gossip_article.csv", encoding = "UTF-8")
order$artDate = order$artDate %>% as.Date("%Y/%m/%d") # 將日期欄位格式由chr轉為date

# 資料處理
data <- order %>% 
  select(artDate, artUrl) %>% # 選出文章和日期欄位
  distinct() # 一篇文章保留一列

我們把報告分為「整體分析」與「兩大外送平台分析」兩個部分介紹。

四、整體分析

I. 日期折線圖

按照日期分群,計算每一天共有幾篇討論文章,可看出討論「外送平台」的熱度

討論文章數最多的10天

article_count_by_date <- data %>% 
  group_by(artDate) %>% 
  summarise(count = n())

article_count_by_date %>% 
  arrange(desc(count))%>% 
  top_n(10)
## Selecting by count
## # A tibble: 10 x 2
##    artDate    count
##    <date>     <int>
##  1 2019-10-14   203
##  2 2019-10-13   135
##  3 2019-10-15   122
##  4 2019-10-11    90
##  5 2019-10-16    77
##  6 2019-10-02    38
##  7 2019-10-20    36
##  8 2019-10-17    35
##  9 2019-10-18    35
## 10 2019-10-12    34

繪製日期折線圖

plot_date <- 
  # data
  article_count_by_date %>% 
  # aesthetics
  ggplot(aes(x = artDate, y = count)) +
  # geometrics
  geom_line(color = "#00AFBB", size = 1) + 
  geom_vline(xintercept = as.numeric(as.Date("2019-10-10")), col='red') + 
  geom_vline(xintercept = as.numeric(as.Date("2019-10-14")), col='red') + 
  geom_vline(xintercept = as.numeric(as.Date("2020-01-21")), col='red') + 
  # coordinates
  scale_x_date(labels = date_format("%Y/%m/%d")) +
  ggtitle("外送平台討論文章數") + 
  xlab("日期") + 
  ylab("文章數")

plot_date

我們進一步將前期幅度較大的曲線移除,讓曲線走向更明顯

plot_date <- 
  # data
  article_count_by_date %>% 
  filter(artDate >= "2019-10-31") %>%
  # aesthetics
  ggplot(aes(x = artDate, y = count)) +
  # geometrics
  geom_line(color = "#00AFBB", size = 1) + 
  geom_vline(xintercept = as.numeric(as.Date("2020-01-15")), col='red') + 
  geom_vline(xintercept = as.numeric(as.Date("2020-04-16")), col='red') + 
  # coordinates
  scale_x_date(labels = date_format("%Y/%m/%d")) +
  ggtitle("外送平台討論文章數") + 
  xlab("日期") + 
  ylab("文章數")

plot_date

從以上兩圖中可以發現:
- 2019年10月10日,討論文章數突然上升
- 2019年10月14日,討論文章數達到最高點(203篇)
- 2020年01月15日,討論文章數為近期高峰
- 2020年01月21日,台灣出現首例新冠病毒確診病例,外送平台的聲量提升幅度並不明顯
- 2020年04月16日,討論文章數再度達到最高點

找出討論聲量高的議題

order %>%
  filter(artDate == as.Date('2020/1/15')) %>%
  distinct(artUrl, .keep_all = TRUE) %>%
  distinct(artTitle, .keep_all = TRUE) %>%
  select(artTitle)
##                                                     artTitle
## 1                      [問卦]ubereats炸雞點了我食量4倍怎麼吃
## 2                           [問卦]熊貓明天罷工,大家會怕嗎?
## 3                               [問卦]熊貓有必要自相殘殺嗎?
## 4                            Re:[問卦]熊貓有必要自相殘殺嗎?
## 5                           [問卦]可憐哪!熊貓外送師被砍獎金
## 6                                   [問卦]熊貓開始罷工了嗎?
## 7                       Re:[問卦]欸欸欸!聽說台灣今天熊貓罷工
## 8                         [問卦]熊貓外送罷工有人被影響到嗎?
## 9                                   [問卦]今天中午能定熊貓嗎
## 10                               Re:[問卦]今天中午能定熊貓嗎
## 11                            [問卦]所以現在熊貓可以點外送嗎
## 12              [新聞]控「年前毀約」!台中60名熊貓外送員市府
## 13    [新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 14                 [新聞]foodpanda罷工實測!點餐後30分就拿到
## 15 Re:[新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 16                [新聞]熊貓變更計薪制度內湖外送員控「變相減
## 17                    [問卦]社會上為何充滿仇視外送員的八卦?

以同樣方式分析以上時間點,可觀察該時間點討論的議題有:
- 2019年10月10日,[新聞] 熊貓外送員深夜搏命送單!
- 2019年10月14日,[新聞] 不甩勞動部!foodpanda:不接受僱傭關係、外送員交通安全疑慮
- 2020年01月15日,[新聞] Foodpanda罷工
- 2020年04月16日,[新聞] Gogoro騎到飽禁商用「外送員遭罰萬元」

II. 文字雲

stop_words <- fread("stop_words.csv", encoding = "UTF-8") #設定停用字
order <- order %>%
  filter(!word %in% stop_words$word)

#將文章按照文字分群並計算每一個字的總詞頻
word_count <- order %>% 
  group_by(word) %>% 
  summarise(sum = sum(count)) %>% 
  arrange(desc(sum))

詞頻最高的前二十名

head(word_count, 20)
## # A tibble: 20 x 2
##    word        sum
##    <chr>     <int>
##  1 外送員     3811
##  2 外送       3135
##  3 熊貓       1360
##  4 外送平台    634
##  5 公司        608
##  6 工作        561
##  7 店家        554
##  8 業者        551
##  9 平台        537
## 10 foodpanda   473
## 11 機車        469
## 12 發生        382
## 13 承攬        376
## 14 車禍        339
## 15 餐點        332
## 16 訂單        313
## 17 美食        309
## 18 服務        289
## 19 送餐        288
## 20 小時        279

依照新冠病毒確診首例日期(1/21)區分資料

data_before <- order %>% filter(artDate < "2020-01-21")
data_after <- order %>% filter(artDate >= "2020-01-21")

data_before <- data_before %>% 
  group_by(word) %>% 
  summarise(sum = sum(count)) %>% 
  arrange(desc(sum))

data_after <- data_after %>% 
  group_by(word) %>% 
  summarise(sum = sum(count)) %>% 
  arrange(desc(sum))

確診首例出現前的文字雲

plot_before <- data_before %>% filter(sum > 150) %>% wordcloud2()
plot_before

確診首例出現後的文字雲

plot_after <- data_after %>% filter(sum > 50) %>% wordcloud2()

III. 長條圖

與文字雲相比,長條圖可以查看較精確的「最常出現詞彙」。

# 將1/21前後的資料加入一個欄位標示後合併起來
word_count <- rbind(data_before %>% mutate(type="before"), data_after %>% mutate(type="after"))

疫情爆發前後出現詞彙的差別

plot_merge <- word_count %>% 
  group_by(type) %>% 
  top_n(15, sum) %>% 
  ungroup() %>% 
  mutate(word = reorder(word, sum)) %>%
  ggplot(aes(x=word, y=sum, fill = type)) +
  geom_col(show.legend = FALSE) +
  labs(x = NULL, y="詞頻") +
  facet_wrap(~type, ncol = 1, scales="free") + 
  coord_flip()

plot_merge

由上圖出現的字詞可以發現討論內容在1/21前後略有不同

接著再進一步將重複的詞彙移除,觀察更明顯的差異

plot_merge <- word_count %>% 
  group_by(type) %>% 
  top_n(30, sum) %>%
  ungroup() %>% 
  group_by(word) %>%
  filter(n()==1) %>%
  ungroup() %>% 
  mutate(word = reorder(word, sum)) %>% 
  ggplot(aes(word, sum, fill = type)) +
  geom_col(show.legend = FALSE) +
  labs(x = NULL, y="總和") +
  facet_wrap(~type, ncol = 1, scales="free") + 
  coord_flip()

plot_merge

重複詞彙移除後,觀察1/21前與1/21後的討論差異:
議題由「交通安全」、「外送員屬於承攬還是僱傭」轉變為「居家隔離」、「疫情」

IV. 情緒分析

# 正向字典txt檔
P <- read_file("dict/liwc/positive.txt")
# 負向字典txt檔
N <- read_file("dict/liwc/negative.txt")

# 將字串依,分割,strsplit回傳 list , 我們取出 list中的第一個元素
P = strsplit(P, ",")[[1]]
N = strsplit(N, ",")[[1]]

# 建立dataframe:有兩個欄位 word, sentiments,word欄位內容是字典向量
P = data.frame(word = P, sentiment = "positive")
N = data.frame(word = N, sentiment = "negative")

LIWC = rbind(P, N)
word_count %>% inner_join(LIWC)
order %>% 
  select(word) %>%
  inner_join(LIWC)

確診首例出現之前的情緒

sentiment_before <- order %>% filter(artDate < "2020-01-21")

sentiment_count = sentiment_before %>%
  select(artDate,word,count) %>%
  inner_join(LIWC) %>% 
  group_by(artDate,sentiment) %>%
  summarise(count=sum(count))

sentiment_count %>%
  ggplot()+
  geom_line(aes(x=artDate,y=count,colour=sentiment))+
  scale_x_date(labels = date_format("%m/%d"))+
  geom_vline(aes(xintercept = as.numeric(artDate[which(sentiment_count$artDate == as.Date('2019/10/10'))[1]])),colour = "red") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(sentiment_count$artDate == as.Date('2019/10/14'))[1]])),colour = "red") 

觀察上圖情緒變化來回顧事件內容:負面情緒在10月10日突然大幅上升,在10月14日達到負面情緒最大值

10月10日當天的「負面」文章

外送員車禍致死新聞

order %>% 
  filter(artDate == as.Date('2019/10/10)')) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## # A tibble: 14 x 4
## # Groups:   artUrl [14]
##    artUrl                            sentiment artTitle                    count
##    <chr>                             <fct>     <chr>                       <int>
##  1 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]【外送搏命1】熊貓外送員拚賺宵夜錢桃園~     5
##  2 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]客控外送員棄單偷吃!本尊親回覆 案情逆~     4
##  3 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]熊貓外送員深夜搏命送單!擦撞貨車噴飛~     4
##  4 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]熊貓外送員深夜搏命送單!擦撞貨車噴飛~     3
##  5 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]女熊貓外送上樓! 男顧客開門吐「3字」~     3
##  6 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]熊貓外送員深夜搏命送單!擦撞貨車噴飛~     2
##  7 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]【外送搏命1】熊貓外送員拚賺宵夜錢桃園~     2
##  8 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]外送員死了叫外送的心安嗎?~     2
##  9 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]住處不送Foodpanda什麼感覺?~     1
## 10 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]現在風向怎麼那麼仇視外送員?~     1
## 11 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]熊貓外送員深夜搏命送單!擦撞貨車噴飛~     1
## 12 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]外送平台會不會導致臺灣亡國?~     1
## 13 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]【外送搏命1】熊貓外送員拚賺宵夜錢~     1
## 14 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]台女還是台男叫外送的多啊?~     1
# 10月10日文字雲
data_1010 <- order %>% 
  filter(artDate == as.Date('2019/10/10')) %>% 
  select(word,count) %>% 
  group_by(word) %>% 
  summarise(count = sum(count))  
  
plot_1010 <- data_1010  %>% filter(count>3) %>%   # 過濾出現太少次的字
  wordcloud2()

查詢10月10日當日文章「正面」與「負面」字詞的使用頻率

order %>%
  filter(artDate == as.Date('2019/10/10')) %>% 
  inner_join(LIWC) %>%
  group_by(word,sentiment) %>%
  summarise(
    count = n()
  ) %>% data.frame() %>% 
  top_n(30,wt = count) %>%
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(word, count, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~sentiment, scales = "free_y") +
  labs(y = "Contribution to sentiment",
       x = NULL) +
  theme(text=element_text(size=14))+
  coord_flip()

10月10日前後的「負面」文章

order %>% 
  filter(artDate %in% c(as.Date('2019/10/09'))) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## # A tibble: 1 x 4
## # Groups:   artUrl [1]
##   artUrl                                 sentiment artTitle                count
##   <chr>                                  <fct>     <chr>                   <int>
## 1 https://www.ptt.cc/bbs/Gossiping/M.15~ negative  [問卦]半夜兩點後外送軟體變廢物?~     2
order %>% 
  filter(artDate %in% c(as.Date('2019/10/11'))) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## # A tibble: 57 x 4
## # Groups:   artUrl [57]
##    artUrl                            sentiment artTitle                    count
##    <chr>                             <fct>     <chr>                       <int>
##  1 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫~    12
##  2 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫~    12
##  3 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫~    11
##  4 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]外送員車禍foodpanda回應了~     9
##  5 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]484該管外送員了           6
##  6 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]熊貓外送員車禍身亡時力參選人質疑平台~     6
##  7 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]作弄外送妹子好好玩XDDD~     5
##  8 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫~     5
##  9 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫~     5
## 10 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]外送員車禍foodpanda回應了~     4
## # ... with 47 more rows

經以上結果發現:
- 10月9日僅有一篇負面文章;
- 10月11日外送員車禍致死的隔天,開始出現大量文章討論車禍事件與外送員的交通安全疑慮

進一步觀察10月10日前後一天文章所使用的正面、負面字詞

order %>%
  filter(artDate == as.Date('2019/10/09')) %>% 
  inner_join(LIWC) %>%
  group_by(word,sentiment) %>%
  summarise(
    count = n()
  ) %>% data.frame() %>% 
  top_n(30,wt = count) %>%
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(word, count, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~sentiment, scales = "free_y") +
  labs(y = "Contribution to sentiment",
       x = NULL) +
  theme(text=element_text(size=14))+
  coord_flip()

order %>%
  filter(artDate == as.Date('2019/10/11')) %>% 
  inner_join(LIWC) %>%
  group_by(word,sentiment) %>%
  summarise(
    count = n()
  ) %>% data.frame() %>% 
  top_n(30,wt = count) %>%
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(word, count, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~sentiment, scales = "free_y") +
  labs(y = "Contribution to sentiment",
       x = NULL) +
  theme(text=element_text(size=14))+
  coord_flip()

可觀察在10號車禍事件發生之後,「違規」、「風險」、「危險」等負面字詞開始出現。
「事故」、「遺憾」、「傷亡」是10號與前後一天不同的字詞,可得知當日聚焦在討論車禍事件上。

外送事故文章的時間點

accident_alias = c("事故","意外", "車禍", "致死")

accident_plot = order %>% 
  filter(nchar(.$word)>1) %>%
  filter(word %in% accident_alias) %>%
  group_by(artDate) %>%  
  summarise(count = n()) %>%
  ggplot(aes(x = artDate, y=count)) +
  geom_col() + 
  ggtitle("與交通事故有關的字詞出現時機點與次數") + 
  xlab("時間") + 
  ylab("次數")

accident_plot

其他時間點的情緒分析

將前期幅度較大的曲線移除,讓曲線走向更明顯

sentiment_before2 <- order %>%
  filter(artDate < "2020-01-21") %>%
  filter(artDate >= "2019-10-31")

sentiment_count2 = sentiment_before2 %>%
  select(artDate, word, count) %>%
  inner_join(LIWC) %>% 
  group_by(artDate, sentiment) %>%
  summarise(count=sum(count))

sentiment_count2 %>%
  ggplot()+
  geom_line(aes(x=artDate,y=count,colour=sentiment))+
  scale_x_date(labels = date_format("%m/%d")) +
  geom_vline(aes(xintercept = as.numeric(artDate[which(sentiment_count2$artDate == as.Date('2020-01-15'))[1]])),colour = "red") 

承第I章提到的議題時間點:1月15日外送員罷工當天文章的「負面」情緒達到高峰

查詢1月15日當日文章「正面」與「負面」字詞的使用頻率

order %>%
  filter(artDate == as.Date('2020/1/15')) %>% 
  inner_join(LIWC) %>%
  group_by(word,sentiment) %>%
  summarise(
    count = n()
  ) %>% data.frame() %>% 
  top_n(30,wt = count) %>%
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(word, count, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~sentiment, scales = "free_y") +
  labs(y = "Contribution to sentiment",
       x = NULL) +
  theme(text=element_text(size=14))+
  coord_flip()

可發現負面字詞中包含「不滿」、「抗爭」等與罷工有關的字詞存在

確診首例出現之後的情緒

sentiment_after <- order %>% filter(artDate >= "2020-01-21")

sentiment_count = sentiment_after %>%
  select(artDate,word,count) %>%
  inner_join(LIWC) %>% 
  group_by(artDate,sentiment) %>%
  summarise(count=sum(count))

sentiment_count %>%
  ggplot()+
  geom_line(aes(x=artDate,y=count,colour=sentiment))+
  scale_x_date(labels = date_format("%m/%d"))+
  geom_vline(aes(xintercept = as.numeric(artDate[which(sentiment_count$artDate == as.Date('2020/02/12'))[1]])),colour = "red") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(sentiment_count$artDate == as.Date('2020/04/16'))[1]])),colour = "red") 

上圖可以看出,2月12日的文章負面情緒達到了頂峰

order %>% filter(artDate == as.Date('2020/02/12')) %>% distinct(artUrl, .keep_all = TRUE)
##                                          artTitle    artDate  artTime
## 1         [問卦]被居家顆隔離時可以訂foodpanda嗎! 2020-02-12 03:53:08
## 2      [問卦]居家自主隔離但是叫熊貓,會不會有問題 2020-02-12 04:32:38
## 3    [新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被 2020-02-12 06:55:35
## 4 Re:[新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被 2020-02-12 07:18:12
## 5    [新聞]影/「黃千千」訂的!雲林foodpanda出現2 2020-02-12 08:11:26
## 6    [新聞]熊貓外送同時遭惡作劇 10餘外送員荒地「 2020-02-12 17:49:42
## 7      [新聞]取代人力!公主號乘客叫紅酒外送竟靠「 2020-02-12 18:08:37
## 8      [新聞]雲林foodpanda惡意棄單3天逾百件20外送 2020-02-12 19:16:03
##                                                     artUrl   word count
## 1 https://www.ptt.cc/bbs/Gossiping/M.1581508750.A.EA8.html   接觸     3
## 2 https://www.ptt.cc/bbs/Gossiping/M.1581511121.A.EBA.html  30CMG     1
## 3 https://www.ptt.cc/bbs/Gossiping/M.1581519697.A.431.html 外送員    15
## 4 https://www.ptt.cc/bbs/Gossiping/M.1581521054.A.E25.html 外送員     3
## 5 https://www.ptt.cc/bbs/Gossiping/M.1581524250.A.150.html 外送員    19
## 6 https://www.ptt.cc/bbs/Gossiping/M.1581558945.A.EC0.html 外送員     8
## 7 https://www.ptt.cc/bbs/Gossiping/M.1581560080.A.D65.html 無人機    13
## 8 https://www.ptt.cc/bbs/Gossiping/M.1581564129.A.B7C.html   訂餐    19

2月12日當天的文字雲

data_0212 <- order %>% 
  filter(artDate == as.Date('2020/02/12')) %>% 
  select(word,count) %>% 
  filter(!word %in% stop_words) %>%
  group_by(word) %>% 
  summarise(count = sum(count)) 
plot_0212 <- data_0212 %>% 
  filter(count>10) %>%   # 過濾出現太少次的字
  wordcloud2()

大事件:雲林客戶狂放棄訂單

order %>% 
  filter(artDate == as.Date('2020/02/12)')) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector
## # A tibble: 8 x 4
## # Groups:   artUrl [8]
##   artUrl                            sentiment artTitle                     count
##   <chr>                             <fct>     <chr>                        <int>
## 1 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被~    11
## 2 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]雲林foodpanda惡意棄單3天逾百件20外~    10
## 3 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]影/「黃千千」訂的!雲林foodpanda出現~     7
## 4 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]熊貓外送同時遭惡作劇 10餘外送員荒地「~     5
## 5 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]取代人力!公主號乘客叫紅酒外送竟靠「~     4
## 6 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被~     2
## 7 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]被居家顆隔離時可以訂foodpanda嗎!~     1
## 8 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]居家自主隔離但是叫熊貓,會不會有問題~     1
order %>%
  filter(artDate == as.Date('2020/02/12')) %>% 
  inner_join(LIWC) %>%
  group_by(word,sentiment) %>%
  summarise(
    count = n()
  ) %>% data.frame() %>% 
  top_n(30,wt = count) %>%
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(word, count, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~sentiment, scales = "free_y") +
  labs(y = "Contribution to sentiment",
       x = NULL) +
  theme(text=element_text(size=14))+
  coord_flip()
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector

2月12日前一天的文章

order %>% 
  filter(artDate %in% c(as.Date('2020/02/11'))) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector
## # A tibble: 4 x 4
## # Groups:   artUrl [4]
##   artUrl                            sentiment artTitle                     count
##   <chr>                             <fct>     <chr>                        <int>
## 1 https://www.ptt.cc/bbs/Gossiping~ negative  [新聞]勞資再戰!熊貓「變相砍薪、假承攬真雇傭~     4
## 2 https://www.ptt.cc/bbs/Gossiping~ negative  [問卦]吳柏毅怎不乘勝追擊打趴熊貓~     2
## 3 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]勞資再戰!熊貓「變相砍薪、假承攬真雇傭~     1
## 4 https://www.ptt.cc/bbs/Gossiping~ negative  Re:[新聞]勞資再戰!熊貓「變相砍薪、假承攬真雇傭~     1

2月12日後一天的文章

order %>% 
  filter(artDate %in% c(as.Date('2020/02/13'))) %>%
  inner_join(LIWC) %>% 
  filter(sentiment == "negative") %>% 
  group_by(artUrl,sentiment) %>% 
  summarise(
    artTitle = artTitle[1],
    count = n()
  ) %>% 
  arrange(desc(count))
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector
## # A tibble: 1 x 4
## # Groups:   artUrl [1]
##   artUrl                                  sentiment artTitle               count
##   <chr>                                   <fct>     <chr>                  <int>
## 1 https://www.ptt.cc/bbs/Gossiping/M.158~ negative  [問卦]台南ubereat現在還好跑嗎?~     2

看出惡意事件發生後人們對台南ubereat的就業前景產生了擔憂

V. TF-IDF

疫情爆發前期(1/21前)

order_before <- order %>% filter(artDate < "2020-01-21")

order_before  <- order_before  %>%
  filter(!str_detect(word, regex("[0-9]"))) %>%
  count(artTitle, word, sort = TRUE)

total_words <- order_before  %>% 
  group_by(artTitle) %>% 
  summarize(total = sum(n)) %>%
  arrange(desc(total))

order_before <- left_join(order_before, total_words)
total_words
## # A tibble: 1,534 x 2
##    artTitle                                       total
##    <chr>                                          <int>
##  1 Re:[新聞]勞檢認定foodpanda、UberEats假承攬真    1629
##  2 Re:[新聞]不甩勞動部!foodpanda:不接受僱傭關係  1091
##  3 Re:[新聞]外送員車禍foodpanda回應了               970
##  4 Re:[新聞]賣命!熊貓美食外送員遭撞慘死超驚悚畫    867
##  5 Re:[新聞]熊貓外送員「可以不要送上樓嗎」…她傻     820
##  6 Re:[新聞]勞動部認定Foodpanda、UberEats與外送     694
##  7 Re:[問卦]同意讓熊貓抽30%的店家在想什麼?         657
##  8 Re:[爆卦]外送員真的月入十萬呢呵呵呵              607
##  9 Re:[爆卦]勞動部認定熊貓跟ubereats是僱傭契約      556
## 10 Re:[問卦]熊貓出新招了這次連顧客一起承攬          532
## # ... with 1,524 more rows
order_tf_idf <- order_before %>%
  bind_tf_idf(word, artTitle, n)
order_tf_idf %>%
  filter(total > 20) %>%
  arrange(desc(tf_idf))
## # A tibble: 75,821 x 7
##    artTitle                              word        n total     tf   idf tf_idf
##    <chr>                                 <chr>   <int> <int>  <dbl> <dbl>  <dbl>
##  1 Re:[問卦]外送員車禍死了叫外送的會知道嗎?~ 人會        2    23 0.0870  4.24  0.369
##  2 [問卦]foodpanda免外送餐點縮水         天填        1    21 0.0476  7.34  0.349
##  3 [問卦]foodpanda免外送餐點縮水         王小華堡~     1    21 0.0476  7.34  0.349
##  4 [問卦]foodpanda免外送餐點縮水         王官        1    21 0.0476  7.34  0.349
##  5 [問卦]foodpanda免外送餐點縮水         兌換券      1    21 0.0476  7.34  0.349
##  6 [問卦]foodpanda免外送餐點縮水         周宜        1    21 0.0476  7.34  0.349
##  7 [問卦]foodpanda免外送餐點縮水         問券        1    21 0.0476  7.34  0.349
##  8 [問卦]foodpanda免外送餐點縮水         紫好        1    21 0.0476  7.34  0.349
##  9 [問卦]foodpanda免外送餐點縮水         號才        1    21 0.0476  7.34  0.349
## 10 [問卦]foodpanda免外送餐點縮水         網小華堡~     1    21 0.0476  7.34  0.349
## # ... with 75,811 more rows
order_before <- order %>% filter(artDate < "2020-01-21")

order_before  <- order_before  %>%
  filter(!str_detect(word, regex("[0-9]"))) %>%
  count(artDate, word, sort = TRUE)

total_words <- order_before  %>% 
  group_by(artDate) %>% 
  summarize(total = sum(n)) %>%
  arrange(desc(total))

order_before <- left_join(order_before, total_words)
order_tf_idf_date <- order_before %>%
  bind_tf_idf(word, artDate, n)
order_tf_idf_date %>%
  filter(total > 20) %>%
  arrange(desc(tf_idf))
## # A tibble: 66,433 x 7
##    artDate    word        n total     tf   idf tf_idf
##    <date>     <chr>   <int> <int>  <dbl> <dbl>  <dbl>
##  1 2019-12-27 火花        1    25 0.04    4.94  0.198
##  2 2019-12-27 完結        1    25 0.04    4.94  0.198
##  3 2019-12-27 完結篇      1    25 0.04    4.94  0.198
##  4 2019-12-27 起肖        1    25 0.04    4.94  0.198
##  5 2019-12-27 葉問        1    25 0.04    4.94  0.198
##  6 2019-12-27 擦出        1    25 0.04    4.94  0.198
##  7 2019-12-01 ZXKQYHP     1    28 0.0357  4.94  0.176
##  8 2019-12-01 心裏        1    28 0.0357  4.94  0.176
##  9 2019-12-01 樁腳        1    28 0.0357  4.94  0.176
## 10 2019-12-26 把車        1    28 0.0357  4.94  0.176
## # ... with 66,423 more rows
order_tf_idf_date %>%
  filter(artDate == as.Date("2019-10-10") | artDate == as.Date("2019-10-14")) %>% 
  group_by(artDate) %>%  
  top_n(1) %>% 
  arrange(artDate)
## # A tibble: 2 x 7
## # Groups:   artDate [2]
##   artDate    word       n total      tf   idf  tf_idf
##   <date>     <chr>  <int> <int>   <dbl> <dbl>   <dbl>
## 1 2019-10-10 撞死       5   965 0.00518  2.30 0.0119 
## 2 2019-10-14 勞健保    34 10074 0.00338  1.76 0.00595

疫情爆發後期(1/21後)

order_after <- order %>% filter(artDate >= "2020-01-21")

order_after  <- order_after  %>%
  filter(!str_detect(word, regex("[0-9]"))) %>%
  count(artTitle, word, sort = TRUE)

total_words <- order_after  %>% 
  group_by(artTitle) %>% 
  summarize(total = sum(n)) %>%
  arrange(desc(total))

order_after <- left_join(order_after, total_words)
total_words
## # A tibble: 398 x 2
##    artTitle                                     total
##    <chr>                                        <int>
##  1 Re:[爆卦]快自首,gogoro對外送員下最後通牒      327
##  2 Re:[爆卦]熊貓foodpanda薪水詳解                 261
##  3 [新聞]寧夏夜市靠外送突圍下一步要走向社交電     254
##  4 [新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被   250
##  5 [新聞]影/「黃千千」訂的!雲林foodpanda出現2   247
##  6 [新聞]外送平台納紓困對象王婉諭:看不出迫切     231
##  7 Re:[問卦]給外送員的1單70是怎麼生出來的?       205
##  8 [新聞]飼主回不了家...武漢外送員代餵貓 開門    197
##  9 [新聞]應召女不能入台老雞頭想轉行送Ubereats     195
## 10 [新聞]Gogoro騎到飽禁商用「外送員遭罰萬元」!   194
## # ... with 388 more rows
order_tf_idf <- order_after %>%
  bind_tf_idf(word, artTitle, n)
order_tf_idf %>%
  filter(total > 20) %>%
  arrange(desc(tf_idf))
## # A tibble: 16,015 x 7
##    artTitle                             word         n total     tf   idf tf_idf
##    <chr>                                <chr>    <int> <int>  <dbl> <dbl>  <dbl>
##  1 [問卦]Ubereats是不是一支非常爛的廣告 三則         1    21 0.0476  5.99  0.285
##  2 [問卦]Ubereats是不是一支非常爛的廣告 小籠包       1    21 0.0476  5.99  0.285
##  3 [問卦]Ubereats是不是一支非常爛的廣告 米醋         1    21 0.0476  5.99  0.285
##  4 [問卦]Ubereats是不是一支非常爛的廣告 實用         1    21 0.0476  5.99  0.285
##  5 [問卦]Ubereats是不是一支非常爛的廣告 薑絲         1    21 0.0476  5.99  0.285
##  6 [問卦]Ubereats是不是一支非常爛的廣告 點鼎泰豐     1    21 0.0476  5.99  0.285
##  7 [問卦]Ubereats是不是一支非常爛的廣告 爛的         1    21 0.0476  5.99  0.285
##  8 [問卦]外送是不是防疫要注意的地方     回店裡       1    21 0.0476  5.99  0.285
##  9 [問卦]外送是不是防疫要注意的地方     這的         1    21 0.0476  5.99  0.285
## 10 [問卦]外送是不是防疫要注意的地方     備料         1    21 0.0476  5.99  0.285
## # ... with 16,005 more rows
order_after <- order %>% filter(artDate >= "2020-01-21")

order_after  <- order_after  %>%
  filter(!str_detect(word, regex("[0-9]"))) %>%
  count(artDate, word, sort = TRUE)

total_words <- order_after  %>% 
  group_by(artDate) %>% 
  summarize(total = sum(n)) %>%
  arrange(desc(total))

order_after <- left_join(order_after, total_words)
order_tf_idf_date <- order_after %>%
  bind_tf_idf(word, artDate, n)
order_tf_idf_date %>%
  filter(total > 20) %>%
  arrange(desc(tf_idf))
## # A tibble: 16,672 x 7
##    artDate    word       n total     tf   idf tf_idf
##    <date>     <chr>  <int> <int>  <dbl> <dbl>  <dbl>
##  1 2020-03-09 小氣       1    23 0.0435  4.50  0.196
##  2 2020-03-09 份量       1    23 0.0435  4.50  0.196
##  3 2020-03-09 吃同       1    23 0.0435  4.50  0.196
##  4 2020-03-09 吳博毅     1    23 0.0435  4.50  0.196
##  5 2020-03-09 超少       1    23 0.0435  4.50  0.196
##  6 2020-03-09 想會       1    23 0.0435  4.50  0.196
##  7 2020-03-09 過嗎       1    23 0.0435  4.50  0.196
##  8 2020-04-02 一笑       1    23 0.0435  4.50  0.196
##  9 2020-04-02 一袋       1    23 0.0435  4.50  0.196
## 10 2020-04-02 油膩       1    23 0.0435  4.50  0.196
## # ... with 16,662 more rows
order_tf_idf_date %>%
  filter(artDate == as.Date("2020-02-12") | artDate == as.Date("2020-04-16")) %>% 
  group_by(artDate) %>%  
  top_n(1) %>% 
  arrange(artDate)
## # A tibble: 6 x 7
## # Groups:   artDate [2]
##   artDate    word       n total      tf   idf tf_idf
##   <date>     <chr>  <int> <int>   <dbl> <dbl>  <dbl>
## 1 2020-02-12 斗六       4  1004 0.00398  4.50 0.0179
## 2 2020-02-12 斗六市     4  1004 0.00398  4.50 0.0179
## 3 2020-02-12 牛肉       4  1004 0.00398  4.50 0.0179
## 4 2020-02-12 車聚       4  1004 0.00398  4.50 0.0179
## 5 2020-02-12 惡搞       4  1004 0.00398  4.50 0.0179
## 6 2020-04-16 商用      10  1371 0.00729  2.71 0.0198

VI. 詞彙相關性分析

整體相關性分析

# 整理資料,挑出artUrl, word, count的欄位
data_word <- order %>% 
  select(artUrl, word, count)
# 計算共同出現的常見單詞對
word_pairs <- data_word %>%
  pairwise_count(word, artUrl, sort = TRUE)
# 計算兩個詞彙間的相關性
word_cors <- data_word%>%
  group_by(word) %>%
  filter(n() >= 20) %>%
  pairwise_cor(word, artUrl, sort = TRUE)
# 設定seed words,並將跟seed words相關性高於0.4的詞彙會被加入移除列表中,整理圖表
seed_words <- c("中時","問卦","時報","三立","聯合","聯合報","tvbs","life","前方","即時")
# 設定threshold爲0.4
threshold <- 0.4

remove_words <- word_cors %>%
                filter((item1 %in% seed_words|item2 %in% seed_words), correlation>threshold) %>%
                .$item1 %>%
                unique()

繪製出correlation > 0.4的圖

word_cors_new <- word_cors %>%
                filter(!(item1 %in% remove_words|item2 %in% remove_words))

word_cors_new %>%
  filter(correlation > 0.4) %>%
  graph_from_data_frame() %>%
  ggraph(layout = "fr") +
  geom_edge_link(aes(edge_alpha = correlation), show.legend = FALSE) + 
  geom_node_point(color = "lightblue", size = 3) +
  geom_node_text(aes(label = name), repel = TRUE) +
  theme_void()

可以看出討論的議題主要有:武漢肺炎、勞工關係、外送員的交通安全、薪資

疫情爆發前期(1/21前)相關性分析

# 整理資料,挑出artUrl, word, count的欄位
data_word <- order %>% 
  filter(artDate < "2020-01-21") %>% 
  select(artUrl, word, count)
# 計算共同出現的常見單詞對
word_pairs <- data_word %>%
  pairwise_count(word, artUrl, sort = TRUE)
# 計算兩個詞彙間的相關性
word_cors <- data_word%>%
  group_by(word) %>%
  filter(n() >= 20) %>%
  pairwise_cor(word, artUrl, sort = TRUE)
# 設定seed words,並將跟seed words相關性高於0.4的詞彙會被加入移除列表中,整理圖表
seed_words <- c("自由","中時","聯合報","政治","聯合")
# 設定threshold爲0.4
threshold <- 0.4
remove_words <- word_cors %>%
                filter((item1 %in% seed_words|item2 %in% seed_words), correlation>threshold) %>%
                .$item1 %>%
                unique()

繪製出correlation > 0.4的圖

word_cors_new <- word_cors %>%
                filter(!(item1 %in% remove_words|item2 %in% remove_words))

word_cors_new %>%
  filter(correlation > 0.4) %>%
  graph_from_data_frame() %>%
  ggraph(layout = "fr") +
  geom_edge_link(aes(edge_alpha = correlation), show.legend = FALSE) + 
  geom_node_point(color = "lightblue", size = 3) +
  geom_node_text(aes(label = name), repel = TRUE) +
  theme_void()

可以看出討論的議題少了武漢肺炎,但其他的議題與整體都差不多,幾乎都是勞工關係、 外送員的交通安全、薪資

疫情爆發後期(1/21後)相關性分析

# 整理資料,挑出artUrl, word, count的欄位
data_word <- order %>% 
  filter(artDate > "2020-01-21") %>% 
  select(artUrl, word, count)
word_pairs <- data_word %>%
  pairwise_count(word, artUrl, sort = TRUE)
# 計算兩個詞彙間的相關性
word_cors <- data_word%>%
  group_by(word) %>%
  filter(n() >= 20) %>%
  pairwise_cor(word, artUrl, sort = TRUE)

繪製出correlation > 0.4的圖

word_cors %>%
  filter(correlation > 0.4) %>%
  graph_from_data_frame() %>%
  ggraph(layout = "fr") +
  geom_edge_link(aes(edge_alpha = correlation), show.legend = FALSE) + 
  geom_node_point(color = "lightblue", size = 3) +
  geom_node_text(aes(label = name), repel = TRUE) +
  theme_void()

可以看出疫情爆發後,肺炎相關的議題討論詞彙出現次數比較多且相關性較強

VII. 整體分析小結

  1. 整體而言,外送平台在這段時間討論聲量較高的新聞分別為:外送員車禍、外送員罷工、客戶惡意棄單與Gogoro騎到飽方案禁止商用。台灣爆發首例武漢肺炎確診的事件之後雖然有在PTT上針對外送平台引起新的議題,但討論聲量卻沒有非常高。
  2. 以詞彙關係圖與統計最常出現詞彙的結果來驗證,首例確診事件發生前的議題多數為勞工關係、外送員交通安全與薪資議題;確診事件發生後開始出現武漢肺炎的議題討論。
  3. 這些主要議題經由情緒分析後皆被視為「負面文章」。

五、Foodpanda和Ubereats分析

資料整理:UberEats

UberEats = c("ubereats","ubereat","Ubereat","UBEREATS","UberEATS","uberEATS")
order$word[which(order$word %in% UberEats)] = "UberEats"

#找出有UberEats的文章網址
ubereats_url = order$artUrl[grepl("UberEats", order$word)]
#依據網址找出有UberEats文章
ubereats_data <- order %>% 
  filter(order$artUrl %in% ubereats_url)

資料整理:Foodpanda

foodpanda = c("FoodPanda","FOODPANDA","Foodpanda","富胖達","food胖達","熊貓")
order$word[which(order$word %in%foodpanda)] = "foodpanda"
#找出有foodpanda的文章網址
foodpanda_url = order$artUrl[grepl("foodpanda", order$word)]
#依據網址找出有foodpanda文章
foodpanda_data <- order %>% 
  filter(order$artUrl %in% foodpanda_url)

I. 聲量比較

為了觀察台灣武漢肺炎爆發前後的聲量和情緒,資料區間避開2019/10月外送員車禍事件的聲量高峰期。

UberEats

1.UberEats聲量趨勢圖
ubereats_1031 <- ubereats_data %>% 
  filter(ubereats_data$artDate > as.Date("2019/10/31"))

ubereats_1031_day <- ubereats_1031 %>% 
  group_by(artDate) %>% 
  summarise(count = n()) %>% 
  arrange(desc(count))
ubereats_1031_day
## # A tibble: 77 x 2
##    artDate    count
##    <date>     <int>
##  1 2020-03-28   404
##  2 2019-11-08   290
##  3 2019-11-22   249
##  4 2020-04-18   234
##  5 2019-11-05   224
##  6 2019-11-11   213
##  7 2020-04-12   201
##  8 2019-11-14   199
##  9 2019-11-21   199
## 10 2020-04-15   181
## # ... with 67 more rows

由下面的趨勢圖可以看出,武漢肺炎爆發之後並沒有立即提高外送平台的討論聲量

day_1031_plot <- ubereats_1031_day %>% 
  ggplot(aes(x = artDate, y = count)) +
  geom_line(color = "purple", size = 1)  + 
  scale_x_date(labels = date_format("%Y/%m/%d")) +  
  geom_vline(xintercept = as.numeric(as.Date("2020-01-21"),col='red',size = 1))+
  ggtitle("ubereats 10/31後每日討論篇數") + 
  xlab("日期") + 
  ylab("數量")
day_1031_plot

2.前五多的文章日期
ubereats_1031_day %>% 
  top_n(5)
## Selecting by count
## # A tibble: 5 x 2
##   artDate    count
##   <date>     <int>
## 1 2020-03-28   404
## 2 2019-11-08   290
## 3 2019-11-22   249
## 4 2020-04-18   234
## 5 2019-11-05   224
ubereats_plot_top5 <- ubereats_1031 %>% 
  filter(artDate == as.Date("2019/11/08") | 
         artDate == as.Date("2019/11/22") | 
         artDate == as.Date("2020/03/28") |
         artDate == as.Date("2020/04/18") | 
         artDate == as.Date("2020/04/10")) %>% 
  group_by(artDate) %>% 
  top_n(5, count) %>% 
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(x=word, y=count, fill = artDate)) +
  geom_col(show.legend = FALSE) +
  labs(x = NULL, y = NULL) +
  facet_wrap(~artDate, scales="free", ncol = 3) + 
  coord_flip()
ubereats_plot_top5 

ubereats_1031 %>% 
  filter(artDate == as.Date("2019/11/08") | 
         artDate == as.Date("2019/11/22") | 
         artDate == as.Date("2020/03/28") |
         artDate == as.Date("2020/04/10") | 
         artDate == as.Date("2020/04/18"))  %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle,artUrl)
##      artDate                                     artTitle
## 1 2019-11-08  [新聞]50K主管「想要月薪10萬」賭氣離職當外送
## 2 2019-11-08 [新聞]消費者被剝皮?外送平台餐食費用多高於店
## 3 2019-11-22      [新聞]外送員車禍身亡1家罰500元1家罰不到
## 4 2019-11-22 [新聞]女大生重病在家超餓!外送員突按門鈴送餐
## 5 2020-03-28  [新聞]今年前二月機車肇事增加外送平台佔4.25%
## 6 2020-03-28   [新聞]寧夏夜市靠外送突圍下一步要走向社交電
## 7 2020-04-10    [新聞]5業者組外送國家隊救餐飲!UberEats、
## 8 2020-04-18                   [問卦]ubereats被盜刷四千元
## 9 2020-04-18               [新聞]外送員趴趴走憂成防疫破口
##                                                     artUrl
## 1 https://www.ptt.cc/bbs/Gossiping/M.1573204052.A.82C.html
## 2 https://www.ptt.cc/bbs/Gossiping/M.1573214540.A.679.html
## 3 https://www.ptt.cc/bbs/Gossiping/M.1574428391.A.B79.html
## 4 https://www.ptt.cc/bbs/Gossiping/M.1574445517.A.94B.html
## 5 https://www.ptt.cc/bbs/Gossiping/M.1585394042.A.C82.html
## 6 https://www.ptt.cc/bbs/Gossiping/M.1585410190.A.3CD.html
## 7 https://www.ptt.cc/bbs/Gossiping/M.1586514906.A.602.html
## 8 https://www.ptt.cc/bbs/Gossiping/M.1587171437.A.983.html
## 9 https://www.ptt.cc/bbs/Gossiping/M.1587215241.A.758.html

重點新聞摘要:
[武漢肺炎爆發前]
1.「想要月薪10萬」賭氣離職當外送員
2.未針對每一餐廳的商品(餐食)定價,揭露「店內價」、「非店內價」的商品資訊,且經過比對,各平台的部份餐廳其外送商品(餐食)的標價,確有出現高於店內消費價格的情形。
3.國慶連假陸續有兩名餐飲外送員車禍身亡,迫使勞動部勞檢並認定兩名外送員分別與美食平台業者Foodpanda、Uber
Eats為雇傭關係,業者依法應為外送員投保勞保與就業保險。但勞保局昨表示,Uber Eats是外商,在台僅有稅籍編號,非勞保強制投保單位,所以無法開罰;另一家Foodpanda則因該外送員僅到職兩天就身亡,試算後,也只能罰五百多元。

[武漢肺炎爆發後]
1.寧夏夜市靠外送突圍,下一步要走向社交電商:武漢肺炎疫情蔓延,寧夏夜市部分攤商業績卻在不景氣中增長3成,關鍵是外送平台是逆襲重要關鍵。不僅如此,也將與電商龍頭合作,估5月可正式走向網路平台。(寧夏夜市觀光協會理事長林定國)
2.今年一至二月機車肇事件數與死傷人數,較前三年增加,市長柯文哲當場質疑跟騎機車美食外送的外送員有關
3.經濟部祭2.65億補助1.2萬家餐飲及零售業者引入外送,昨5家本土業者組成國家隊,並自願將抽成砍半到15%甚至5%(utaway(賽米資訊)、有無外送、Foodomo(專聯科技)將原本25%到35%抽成降到15%;inline則直接僅抽5%;全球快遞過去每趟運送費為100元,也降低到75元。)。但兩大外送龍頭Ubereats、Foodpanda不約而同都未入列,經濟部揭露原因表示Uber eats正在申請投資許可,而Foodpanda有申請但正在審查中,但也鼓勵國內外所有外送平台都願意降低抽成比例,一起組建外送國家隊。
4.陳時中表示,外送員及郵遞員確實有風險,如何做到不接觸又可以送達、簽收及取款是努力的方向,但仍不考慮對居家檢疫及隔離者做標注。

Foodpanda

1.Foodpanda聲量趨勢圖
foodpanda_1031 <- foodpanda_data %>% 
  filter(foodpanda_data$artDate > as.Date("2019/10/31"))

foodpanda_1031_day <- foodpanda_1031 %>% 
  group_by(artDate) %>% 
  summarise(count = n()) %>% 
  arrange(desc(count))
foodpanda_1031_day
## # A tibble: 136 x 2
##    artDate    count
##    <date>     <int>
##  1 2020-02-12   815
##  2 2020-01-15   799
##  3 2020-01-16   658
##  4 2020-01-18   617
##  5 2020-01-13   616
##  6 2019-11-09   584
##  7 2019-12-05   530
##  8 2019-11-08   504
##  9 2020-04-18   447
## 10 2020-02-14   419
## # ... with 126 more rows
foodpanda_day_1031_plot <- foodpanda_1031_day %>% 
  ggplot(aes(x = artDate, y = count)) +
  geom_line(color = "purple", size = 1)  + 
  scale_x_date(labels = date_format("%Y/%m/%d")) +  
  geom_vline(xintercept = as.numeric(as.Date("2020-01-21"),col='red',size = 1))+
  ggtitle("Foodpanda 10/31後每日討論篇數") + 
  xlab("日期") + 
  ylab("數量")
foodpanda_day_1031_plot

2.前五多的文章日期
foodpanda_1031_day %>% 
  top_n(5)
## Selecting by count
## # A tibble: 5 x 2
##   artDate    count
##   <date>     <int>
## 1 2020-02-12   815
## 2 2020-01-15   799
## 3 2020-01-16   658
## 4 2020-01-18   617
## 5 2020-01-13   616
foodpanda_plot_top5 <- foodpanda_1031 %>% 
  filter(artDate == as.Date("2019/11/08") | 
         artDate == as.Date("2019/12/05") | 
         artDate == as.Date("2020/01/15") |
         artDate == as.Date("2020/02/12") | 
         artDate == as.Date("2020/04/18")) %>% 
  group_by(artDate) %>% 
  top_n(10, count) %>% 
  ungroup() %>% 
  mutate(word = reorder(word, count)) %>%
  ggplot(aes(x=word, y=count, fill = artDate)) +
  geom_col(show.legend = FALSE) +
  labs(x = NULL, y = NULL) +
  facet_wrap(~artDate, scales="free", ncol = 3) + 
  coord_flip()
foodpanda_plot_top5 

foodpanda_1031 %>% 
  filter(artDate == as.Date("2019/11/08") | 
         artDate == as.Date("2019/12/05") | 
         artDate == as.Date("2020/01/15") |
         artDate == as.Date("2020/02/12") | 
         artDate == as.Date("2020/04/18"))  %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle,artUrl)
##       artDate                                                      artTitle
## 1  2019-11-08                  [新聞]消費者被剝皮?外送平台餐食費用多高於店
## 2  2019-11-08                          [問卦]有沒有當外送可以進正妹家的卦?
## 3  2019-11-08                           [問卦]板上有人沒用過foodpanda的嗎?
## 4  2019-11-08                        Re:[問卦]板上有人沒用過foodpanda的嗎?
## 5  2019-11-08                        Re:[問卦]板上有人沒用過foodpanda的嗎?
## 6  2019-11-08                             Re:[新聞]王思聰旗下熊貓直播傳破產
## 7  2019-11-08                        Re:[問卦]板上有人沒用過foodpanda的嗎?
## 8  2019-12-05                                        [問卦]天冷熊貓還跑嗎?
## 9  2019-12-05                  [新聞]不滿外送員沒零錢面膜女爆打外送員抓下體
## 10 2019-12-05                              Re:[問卦]下雨天點外送是不是很爽?
## 11 2019-12-05 [新聞]比熊貓還稀有!蘇格蘭野貓全球剩400隻 2022年首度野放大自
## 12 2019-12-05                               [問卦]foodpanda是不是快不行了?
## 13 2019-12-05                                [問卦]好想和女熊貓做愛,怎辦?
## 14 2019-12-05                   [新聞]foodpanda刪除外送員評鑑制度 留獎勵機
## 15 2020-01-15                              [問卦]熊貓明天罷工,大家會怕嗎?
## 16 2020-01-15                                  [問卦]熊貓有必要自相殘殺嗎?
## 17 2020-01-15                               Re:[問卦]熊貓有必要自相殘殺嗎?
## 18 2020-01-15                              [問卦]可憐哪!熊貓外送師被砍獎金
## 19 2020-01-15                                      [問卦]熊貓開始罷工了嗎?
## 20 2020-01-15                          Re:[問卦]欸欸欸!聽說台灣今天熊貓罷工
## 21 2020-01-15                            [問卦]熊貓外送罷工有人被影響到嗎?
## 22 2020-01-15                                      [問卦]今天中午能定熊貓嗎
## 23 2020-01-15                                   Re:[問卦]今天中午能定熊貓嗎
## 24 2020-01-15                  [新聞]控「年前毀約」!台中60名熊貓外送員市府
## 25 2020-01-15        [新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 26 2020-01-15                     [新聞]foodpanda罷工實測!點餐後30分就拿到
## 27 2020-01-15     Re:[新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 28 2020-01-15     Re:[新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 29 2020-01-15                    [新聞]熊貓變更計薪制度內湖外送員控「變相減
## 30 2020-01-15                        [問卦]社會上為何充滿仇視外送員的八卦?
## 31 2020-02-12                    [問卦]居家自主隔離但是叫熊貓,會不會有問題
## 32 2020-02-12                  [新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被
## 33 2020-02-12                  [新聞]影/「黃千千」訂的!雲林foodpanda出現2
## 34 2020-02-12                  [新聞]熊貓外送同時遭惡作劇 10餘外送員荒地「
## 35 2020-02-12                    [新聞]雲林foodpanda惡意棄單3天逾百件20外送
## 36 2020-04-18                                [問卦]為何跑熊貓會被人看不起?
## 37 2020-04-18                                    [問卦]熊貓外送年齡變高了?
## 38 2020-04-18                                 Re:[問卦]熊貓外送年齡變高了?
## 39 2020-04-18                    [問卦]有沒有叫熊貓,發現送來的是鄰居的八卦
## 40 2020-04-18                                [新聞]外送員趴趴走憂成防疫破口
## 41 2020-04-18                    [新聞]熊貓王姓外送員騎機車與汽車碰撞王男受
## 42 2020-04-18                    [新聞]驚險!熊貓外送員撞車「慘成火球」 客
##                                                      artUrl
## 1  https://www.ptt.cc/bbs/Gossiping/M.1573214540.A.679.html
## 2  https://www.ptt.cc/bbs/Gossiping/M.1573218796.A.F5B.html
## 3  https://www.ptt.cc/bbs/Gossiping/M.1573274499.A.41D.html
## 4  https://www.ptt.cc/bbs/Gossiping/M.1573278564.A.8E1.html
## 5  https://www.ptt.cc/bbs/Gossiping/M.1573278855.A.090.html
## 6  https://www.ptt.cc/bbs/Gossiping/M.1573279890.A.61F.html
## 7  https://www.ptt.cc/bbs/Gossiping/M.1573281732.A.508.html
## 8  https://www.ptt.cc/bbs/Gossiping/M.1575535036.A.FFB.html
## 9  https://www.ptt.cc/bbs/Gossiping/M.1575543109.A.D93.html
## 10 https://www.ptt.cc/bbs/Gossiping/M.1575544655.A.8C3.html
## 11 https://www.ptt.cc/bbs/Gossiping/M.1575561309.A.116.html
## 12 https://www.ptt.cc/bbs/Gossiping/M.1575562455.A.17B.html
## 13 https://www.ptt.cc/bbs/Gossiping/M.1575604895.A.1A7.html
## 14 https://www.ptt.cc/bbs/Gossiping/M.1575614882.A.A04.html
## 15 https://www.ptt.cc/bbs/Gossiping/M.1579084393.A.F0D.html
## 16 https://www.ptt.cc/bbs/Gossiping/M.1579088242.A.94B.html
## 17 https://www.ptt.cc/bbs/Gossiping/M.1579088784.A.D87.html
## 18 https://www.ptt.cc/bbs/Gossiping/M.1579106822.A.063.html
## 19 https://www.ptt.cc/bbs/Gossiping/M.1579129029.A.890.html
## 20 https://www.ptt.cc/bbs/Gossiping/M.1579133047.A.48D.html
## 21 https://www.ptt.cc/bbs/Gossiping/M.1579138472.A.14A.html
## 22 https://www.ptt.cc/bbs/Gossiping/M.1579138944.A.272.html
## 23 https://www.ptt.cc/bbs/Gossiping/M.1579139900.A.F7E.html
## 24 https://www.ptt.cc/bbs/Gossiping/M.1579151065.A.23C.html
## 25 https://www.ptt.cc/bbs/Gossiping/M.1579152088.A.C9B.html
## 26 https://www.ptt.cc/bbs/Gossiping/M.1579154317.A.E0C.html
## 27 https://www.ptt.cc/bbs/Gossiping/M.1579154864.A.DC6.html
## 28 https://www.ptt.cc/bbs/Gossiping/M.1579155632.A.F04.html
## 29 https://www.ptt.cc/bbs/Gossiping/M.1579157340.A.3DA.html
## 30 https://www.ptt.cc/bbs/Gossiping/M.1579159400.A.B4D.html
## 31 https://www.ptt.cc/bbs/Gossiping/M.1581511121.A.EBA.html
## 32 https://www.ptt.cc/bbs/Gossiping/M.1581519697.A.431.html
## 33 https://www.ptt.cc/bbs/Gossiping/M.1581524250.A.150.html
## 34 https://www.ptt.cc/bbs/Gossiping/M.1581558945.A.EC0.html
## 35 https://www.ptt.cc/bbs/Gossiping/M.1581564129.A.B7C.html
## 36 https://www.ptt.cc/bbs/Gossiping/M.1587177122.A.D43.html
## 37 https://www.ptt.cc/bbs/Gossiping/M.1587180542.A.8BE.html
## 38 https://www.ptt.cc/bbs/Gossiping/M.1587205233.A.519.html
## 39 https://www.ptt.cc/bbs/Gossiping/M.1587205611.A.A47.html
## 40 https://www.ptt.cc/bbs/Gossiping/M.1587215241.A.758.html
## 41 https://www.ptt.cc/bbs/Gossiping/M.1587225472.A.E42.html
## 42 https://www.ptt.cc/bbs/Gossiping/M.1587225632.A.ED6.html

重點新聞摘要:
[武漢肺炎爆發前]
1.[問卦] foodpanda是不是快不行了?:免運取消加上合作餐廳數量減少
2.台灣熊貓罷工

[武漢肺炎爆發後]
1.居家自主隔離但是叫熊貓,會不會有問題
2.外送平台「foodpanda」近來正夯,雲林縣斗六市外送員們之間流傳,從10日開始連續三天遭惡意大量訂餐,外送員找不到訂餐者,甚至遭惡整到荒郊野外,三天已有上百件惡意棄單,粗估3天來總訂餐費用已逾7萬元,讓外送員們直呼做白工,並希望惡作劇快落幕。
3.[新聞]外送員趴趴走憂成防疫破口
4.[新聞]驚險!熊貓外送員撞車「慘成火球」

II. 情緒比較

以LIWC字典統計每天的文章正面字的次數與負面字的次數

UberEats

1.情緒趨勢圖
ubereats_sentiment_count = ubereats_1031 %>%
  select(artDate,word,count) %>%
  inner_join(LIWC) %>% 
  group_by(artDate,sentiment) %>%
  summarise(count=sum(count))
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector
ubereats_sentiment_count %>%
  ggplot()+
  geom_line(aes(x=artDate,y=count,colour=sentiment))+
  scale_x_date(labels = date_format("%m/%d")) +
  geom_vline(aes(xintercept = as.numeric(artDate[which(ubereats_sentiment_count$artDate == as.Date('2019/11/25'))[1]])),colour = "red") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(ubereats_sentiment_count$artDate == as.Date('2020/03/28'))[1]])),colour = "red") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(ubereats_sentiment_count$artDate == as.Date('2020/04/18'))[1]])),colour = "blue") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(ubereats_sentiment_count$artDate == as.Date('2019/11/14'))[1]])),colour = "blue")

ubereats_sentiment_count %>% 
  arrange(desc(count))
## # A tibble: 102 x 3
## # Groups:   artDate [61]
##    artDate    sentiment count
##    <date>     <fct>     <int>
##  1 2020-03-28 positive     16
##  2 2019-11-25 positive     15
##  3 2020-04-10 positive     14
##  4 2020-04-18 negative     13
##  5 2019-11-27 positive     11
##  6 2020-04-12 negative     11
##  7 2020-04-21 negative     11
##  8 2019-11-14 negative     10
##  9 2019-11-05 positive      9
## 10 2019-11-08 negative      9
## # ... with 92 more rows
2.正面情緒高峰
ubereats_1031 %>% 
  filter(artDate == as.Date("2019/11/25") |
         artDate == as.Date("2020/03/28") )  %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle)
##      artDate                                    artTitle
## 1 2019-11-25        [新聞]吃得苦中苦外送員月薪打趴上班族
## 2 2020-03-28 [新聞]今年前二月機車肇事增加外送平台佔4.25%
## 3 2020-03-28  [新聞]寧夏夜市靠外送突圍下一步要走向社交電

[武漢肺炎前] 1. 薪資探討

[武漢肺炎後] 1. 車禍預期增加? 2. 寧夏夜市靠外送突圍

3.負面情緒高峰
ubereats_1031 %>% 
  filter(artDate == as.Date("2019/11/14") |
         artDate == as.Date("2020/04/18") ) %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle)
##      artDate                                   artTitle
## 1 2019-11-14    Re:[問卦]UberEats有限制一定要用機車嗎?
## 2 2019-11-14 [新聞]UBEREATS送餐員撞傷女騎士業務過失傷害
## 3 2020-04-18                 [問卦]ubereats被盜刷四千元
## 4 2020-04-18             [新聞]外送員趴趴走憂成防疫破口

[武漢肺炎前] 車禍議題

[武漢肺炎後] 外送員是否會造成防疫破口

4.與疫情相關的文章
covid <- c("防疫","疫情","檢疫","居家","檢疫","武漢","肺炎","武漢肺炎","COVID-19","covid-19","COVID19","covid19")
data_ubereats_co <- ubereats_data %>% 
  filter(ubereats_data$word %in% covid) %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artTitle,artDate,word,count)
data_ubereats_co
##                                       artTitle    artDate word count
## 1   [問卦]外送人員是不是武漢肺炎的高風險職業? 2020-01-28 居家     1
## 2          [問卦]這波疫情會讓外送平台發大財嗎? 2020-02-04 疫情     1
## 3    [問卦]Ubereat外送員說他有送過隔離的人怎辦 2020-02-09 居家     1
## 4              [問卦]台南ubereat現在還好跑嗎? 2020-02-13 武漢     1
## 5          Re:[問卦]外送員會不會變成防疫破口? 2020-03-25 居家     5
## 6  [新聞]今年前二月機車肇事增加外送平台佔4.25% 2020-03-28 武漢     1
## 7   [新聞]寧夏夜市靠外送突圍下一步要走向社交電 2020-03-28 疫情     7
## 8    [新聞]5業者組外送國家隊救餐飲!UberEats、 2020-04-10 疫情     3
## 9   [新聞]外送員慘了!Gogoro嚴查違規車強制升級 2020-04-15 肺炎     1
## 10      [新聞]點餐平台不提供口罩外送員自抗風險 2020-04-17 防疫     4
## 11              [新聞]外送員趴趴走憂成防疫破口 2020-04-18 居家     4
## 12  [新聞]UberEats的復仇!早餐店嗆:嘴巴閉閉乖 2020-04-21 疫情     1

Foodpanda

1.情緒趨勢圖
foodpanda_sentiment_count = foodpanda_1031 %>%
  select(artDate,word,count) %>%
  inner_join(LIWC) %>% 
  group_by(artDate,sentiment) %>%
  summarise(count=sum(count))
## Joining, by = "word"
## Warning: Column `word` joining character vector and factor, coercing into
## character vector
foodpanda_sentiment_count %>%
  ggplot()+
  geom_line(aes(x=artDate,y=count,colour=sentiment))+
  scale_x_date(labels = date_format("%m/%d")) +
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count$artDate == as.Date('2020/02/12'))[1]])),colour = "blue") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count$artDate == as.Date('2020/01/15'))[1]])),colour = "blue") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count$artDate == as.Date('2020/04/10'))[1]])),colour = "red") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count$artDate == as.Date('2019/11/09'))[1]])),colour = "blue") 

foodpanda_sentiment_count %>% 
  arrange(desc(count))
## # A tibble: 202 x 3
## # Groups:   artDate [116]
##    artDate    sentiment count
##    <date>     <fct>     <int>
##  1 2020-02-12 negative     73
##  2 2020-01-15 negative     49
##  3 2020-04-10 positive     34
##  4 2020-01-15 positive     29
##  5 2019-11-09 negative     27
##  6 2019-11-29 positive     27
##  7 2019-12-13 negative     27
##  8 2020-01-13 positive     27
##  9 2019-11-09 positive     25
## 10 2020-01-13 negative     24
## # ... with 192 more rows
2.正面情緒高峰
foodpanda_1031 %>% 
  filter(artDate == as.Date("2020/04/10"))  %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle)
##      artDate                                    artTitle
## 1 2020-04-10 [新聞]安心配送再升級!foodpanda發萬瓶酒精給
## 2 2020-04-10   [新聞]5業者組外送國家隊救餐飲!UberEats、
## 3 2020-04-10              [問卦]外送員也適用紓困方案嗎?

[武漢肺炎後] 1. 外送平台公司的防疫措施 2. 政府政策 3. 外送員也適用紓困方案嗎?

3.負面情緒高峰
foodpanda_1031 %>% 
  filter(artDate == as.Date("2020/02/12") |
         artDate == as.Date("2020/01/15") |
         artDate == as.Date("2019/11/09") ) %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artDate,artTitle)
##       artDate                                                  artTitle
## 1  2019-11-09                         Re:[新聞]王思聰旗下熊貓直播傳破產
## 2  2019-11-09                    Re:[問卦]板上有人沒用過foodpanda的嗎?
## 3  2019-11-09                [新聞]foodpanda下班逛東區百貨…樓管「禁現樓
## 4  2019-11-09                    [問卦]熊貓是不是解決了生活機能問題啊?
## 5  2019-11-09                 Re:[問卦]熊貓是不是解決了生活機能問題啊?
## 6  2019-11-09                               [問卦]有沒有foodpanda的卦?
## 7  2020-01-15                          [問卦]熊貓明天罷工,大家會怕嗎?
## 8  2020-01-15                              [問卦]熊貓有必要自相殘殺嗎?
## 9  2020-01-15                           Re:[問卦]熊貓有必要自相殘殺嗎?
## 10 2020-01-15                          [問卦]可憐哪!熊貓外送師被砍獎金
## 11 2020-01-15                                  [問卦]熊貓開始罷工了嗎?
## 12 2020-01-15                      Re:[問卦]欸欸欸!聽說台灣今天熊貓罷工
## 13 2020-01-15                        [問卦]熊貓外送罷工有人被影響到嗎?
## 14 2020-01-15                                  [問卦]今天中午能定熊貓嗎
## 15 2020-01-15                               Re:[問卦]今天中午能定熊貓嗎
## 16 2020-01-15              [新聞]控「年前毀約」!台中60名熊貓外送員市府
## 17 2020-01-15    [新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 18 2020-01-15                 [新聞]foodpanda罷工實測!點餐後30分就拿到
## 19 2020-01-15 Re:[新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 20 2020-01-15 Re:[新聞]熊貓今罷送最多慢1小時…外送員:萬人響應卻無人棄單
## 21 2020-01-15                [新聞]熊貓變更計薪制度內湖外送員控「變相減
## 22 2020-01-15                    [問卦]社會上為何充滿仇視外送員的八卦?
## 23 2020-02-12                [問卦]居家自主隔離但是叫熊貓,會不會有問題
## 24 2020-02-12              [新聞]雲林惡客狂棄訂單 20名熊貓外送員同時被
## 25 2020-02-12              [新聞]影/「黃千千」訂的!雲林foodpanda出現2
## 26 2020-02-12              [新聞]熊貓外送同時遭惡作劇 10餘外送員荒地「
## 27 2020-02-12                [新聞]雲林foodpanda惡意棄單3天逾百件20外送

[武漢肺炎前] 罷工議題

[武漢肺炎後] 1. 居家自主隔離但是叫熊貓 2. 雲林集體棄單

4.與疫情相關的文章
covid <- c("防疫","疫情","檢疫","居家","檢疫","武漢","肺炎","武漢肺炎","COVID-19","covid-19","COVID19","covid19")
data_foodpanda_co <- foodpanda_data %>% 
  filter(foodpanda_data$word %in% covid) %>% 
  distinct(artUrl, .keep_all = TRUE) %>% 
  select(artTitle,artDate,word,count)
data_foodpanda_co
##                                                         artTitle    artDate
## 1                                           [問卦]熊貓仔要正名!! 2019-10-16
## 2                     [問卦]外送人員是不是武漢肺炎的高風險職業? 2020-01-28
## 3                             [問卦]還沒提供外送的店家在想什麼? 2020-01-30
## 4                            [問卦]這波疫情會讓外送平台發大財嗎? 2020-02-04
## 5                               [問卦]吳柏毅怎不乘勝追擊打趴熊貓 2020-02-11
## 6                     [問卦]居家自主隔離但是叫熊貓,會不會有問題 2020-02-12
## 7                           [問卦]熊貓、吳博弈外送怎麼都不見了?? 2020-02-28
## 8                    [新聞]外送員不爽上樓!朝女兒「咳嗽噴口水」… 2020-03-01
## 9                     [新聞]熊貓免運加麥當勞超殺優惠網友狂買「25 2020-03-08
## 10                                    [問卦]居家隔離該選哪間外送 2020-03-20
## 11 [新聞]「爆兇」嫩妹居家檢疫落跑買飯 蘆洲警問怎不叫外送…她奶聲 2020-03-23
## 12                   [新聞]foodpanda啟動「全台店家紓困轉型專案」 2020-03-27
## 13                    [新聞]寧夏夜市靠外送突圍下一步要走向社交電 2020-03-28
## 14                    [新聞]免費幫投保!熊貓外送員「染疫可領1萬5 2020-03-31
## 15                  [新聞]咳嗽女現金放門外付款!外送員不安「在隔 2020-04-06
## 16                  [新聞]沒遊客才能放鬆!香港熊貓睽違九年首自然 2020-04-09
## 17                   [新聞]安心配送再升級!foodpanda發萬瓶酒精給 2020-04-10
## 18                     [新聞]5業者組外送國家隊救餐飲!UberEats、 2020-04-10
## 19                                [問卦]外送員也適用紓困方案嗎? 2020-04-10
## 20                            [問卦]熊貓的處置需不需要超前部屬? 2020-04-15
## 21                     Re:[問卦]騎gogoro吃到飽方案外送被罰死怎辦 2020-04-16
## 22                        [新聞]點餐平台不提供口罩外送員自抗風險 2020-04-17
## 23                                [新聞]外送員趴趴走憂成防疫破口 2020-04-18
##    word count
## 1  居家     1
## 2  居家     1
## 3  武漢     1
## 4  疫情     1
## 5  肺炎     1
## 6  居家     1
## 7  武漢     1
## 8  武漢     1
## 9  疫情     2
## 10 居家     1
## 11 檢疫     9
## 12 肺炎     1
## 13 疫情     7
## 14 防疫     6
## 15 居家     3
## 16 疫情     1
## 17 防疫     1
## 18 疫情     3
## 19 疫情     1
## 20 疫情     1
## 21 疫情     1
## 22 防疫     4
## 23 居家     4

討論議題重點擷取
[相關議題探討]
1.外送員為高風險族群、點餐平台不提供口罩外送員自抗風險
2.這波疫情會讓外送平台發大財嗎?
3.免費幫投保!熊貓外送員「染疫可領1萬5補償金」 2個月內有上線
4.安心配送再升級!foodpanda發萬瓶酒精

[產業結盟] 1.foodpanda啟動全台店家紓困轉型專案2.業者組外送國家隊救餐飲! 3.外送員也適用紓困方案嗎?

III. 兩大平台交叉比較

聲量趨勢:在PTT的媒體上,Foodpanda的聲量普遍高於UberEats,能是因為Foodpanda的使用者較多,且近期有較多被討論的議題(重大車禍、勞雇關係和罷工等),這也影響了情緒的表現上Foodpanda的起伏會有較大的高低落差。

foodpanda_1031_day<- foodpanda_1031_day%>% mutate(Brand="panda")
ubereats_1031_day<- ubereats_1031_day%>% mutate(Brand="ubereats")
volume<-bind_rows(foodpanda_1031_day,ubereats_1031_day)%>%
  ggplot(aes(x = artDate, y = count)) +
  geom_line(aes(color = Brand), size = 0.5)+ 
  scale_x_date(labels = date_format("%m/%d"))+ 
  ggtitle("品牌聲量比較") 
volume

1.正面情緒趨勢

foodpanda_sentiment_count_p<-foodpanda_sentiment_count %>% filter(sentiment=="positive") %>% mutate(Brand="panda")

ubereats_sentiment_count_p<-ubereats_sentiment_count %>% filter(sentiment=="positive") %>% mutate(Brand="ubereats")

sentiment_p<-bind_rows(foodpanda_sentiment_count_p,ubereats_sentiment_count_p)%>%
  ggplot(aes(x = artDate, y = count)) +
  geom_line(aes(color = Brand), size = 0.5)+ 
  scale_x_date(labels = date_format("%m/%d"))+
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count_p$artDate == as.Date('2020/04/10'))[1]])),colour = "red")+
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count_p$artDate == as.Date('2020/03/31'))[1]])),colour = "red")+ 
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count_p$artDate == as.Date('2020/03/28'))[1]])),colour = "blue") +
  ggtitle("正情緒趨勢比較") 
sentiment_p

1.’2020/03/31’:免費幫投保 2.’2020/04/10’:foodpanda發萬瓶酒精[ubereats]: 1.’2020/03/28’:寧夏夜市靠外送突圍

2.負情緒趨勢

foodpanda_sentiment_count_n<-foodpanda_sentiment_count %>% filter(sentiment=="negative") %>% mutate(Brand="panda")

ubereats_sentiment_count_n<-ubereats_sentiment_count %>% filter(sentiment=="negative") %>% mutate(Brand="ubereats")

sentiment_n<-bind_rows(foodpanda_sentiment_count_n,ubereats_sentiment_count_n)%>%
  ggplot(aes(x = artDate, y = count)) +
  geom_line(aes(color = Brand), size = 0.5)+ 
  scale_x_date(labels = date_format("%m/%d"))+
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count_n$artDate == as.Date('2020/02/12'))[1]])),colour = "blue") +
  geom_vline(aes(xintercept = as.numeric(artDate[which(foodpanda_sentiment_count_n$artDate == as.Date('2020/01/15'))[1]])),colour = "blue")+ 
  ggtitle("負正情緒趨勢比較") 
sentiment_n

foodpanda 1.’2020/01/15’:熊貓罷工 2.’2020/02/12’:雲林foodpanda惡意棄單

IV. 兩大平台分析小結

  1. 武漢肺炎爆發後雖然外送平台的使用率上升,但在ptt的討論上聲量並沒有立即增加
  2. 討論議題逐漸浮出(紓困方案、產業合作和交通安全等)
  3. 通常與政府議題相關報導會反映出較為正向的情緒
  4. 與疫情相關的文章,通常不會有較大的情緒表現,若有通常偏正向情緒

六、總結

綜合上述的觀察後,我們發現雖然外送平台訂單量隨著武漢肺炎的爆發使用量大幅上升,但在PTT討論版中並沒有馬上引起相關討論,而是到三月中才開始出現與武漢肺炎相關的新聞(主要的議題聲量仍在「交通安全」、「勞資」與「罷工」等議題),報導外送平台替防疫中的用戶帶來的方便與好處,以我們選用的LIWC字典分析,也很少在文章中定義出情緒表現。