取得 keys
你也可以透過程式方式讀取與設定 keys。在這個練習中,netflix 和 imdb 之中只有一個已設定 key。你的任務是先找出是哪個 data.table 已設定了 key,然後用它來設定另一個 data.table 的 key。
本練習屬於課程
R 的 data.table 資料合併
練習說明
- 檢查
netflix和imdb是否已設定任何 key。 - 將已經有 key 的
data.table的 key 指派給the_key。 - 使用
the_key為另一個data.table設定 key。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Check for keys
___
___
# Find the key
the_key <- ___
# Set the key for the other data.table
___(___, ___)