終極對決,第二回合!負面評價
在兩家組織中,人們都提到「culture」和「smart people」,因此兩家公司之間有一些相似的正面面向。不過,透過金字塔圖,你可以開始推敲工作環境中正面特徵的程度差異。
現在你要把注意力轉向負面評價,並製作相同的視覺化。這次你的工作空間中已經有 common_words 資料框。不過,這個練習中的常見雙字詞來自員工的「負面」評論。
本練習屬於課程
R 的 Bag-of-Words 文本探勘
練習說明
- 對
common_words使用slice_max(),針對diff欄位取得前5個雙字詞。新物件的結果會印出在你的主控台。 - 建立
pyramid.plot()。傳入top5_df$AmazonNeg、top5_df$GoogleNeg,以及labels = top5_df$terms。為了更清楚的標示,將gap設為12。top.labels設為c("Amzn", "Neg Words", "Goog")
main 和 unit 參數已為你設定好。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Extract top 5 common bigrams
(top5_df <- ___ %>% ___(___, n = ___))
# Create a pyramid plot
___(
# Amazon on the left
top5_df$___,
# Google on the right
top5_df$___,
# Use terms for labels
labels = top5_df$___,
# Set the gap to 12
___ = ___,
# Set top.labels to "Amzn", "Neg Words" & "Goog"
___ = ___,
main = "Words in Common",
unit = NULL
)