Batman 與 Star Wars 的差異
在影片中,你比較了兩個組合。現在,你要比較兩個主題,而每個主題都由許多組合構成。
首先,你需要把 themes 加進來。請記得,這需要先經過 sets。你會使用影片中的 inventory_parts_joined 資料表,主控台已經為你準備好。
inventory_parts_joined <- inventories %>%
inner_join(inventory_parts, by = c("id" = "inventory_id")) %>%
arrange(desc(quantity)) %>%
select(-id, -version)
本練習屬於課程
使用 dplyr 進行資料表連接
練習說明
- 若要把 themes 加進來,你需要先合併
inventory_parts_joined與sets資料表。 - 接著,把第一次的 join 再與
themes資料表合併,並使用 suffix 參數來標示每個name來自哪一個資料表("_set"或"_theme")。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Start with inventory_parts_joined table
inventory_parts_joined %>%
# Combine with the sets table
___ %>%
# Combine with the themes table
___