開始使用免費開始

掌握簡單的連接

你的 R 工作階段中已載入 3 個包含澳洲地理與人口資訊的 data.tableareacapitals,以及 population。你的目標是依序進行連接,組成一個單一的 data.table,內容包含各澳洲州別的地理面積,以及其首都的人口,並將最終結果存入新變數:australia_stats。因為有 3 個 data.table,你需要執行 2 次連接。首先,將 capitalspopulation 連接,接著把得到的 data.table 再與 area 連接。

本練習屬於課程

R 的 data.table 資料合併

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Identify the key for joining capitals and population
capitals_population_key <- ___

# Left join population to capitals
capital_pop <- ___
capital_pop
編輯並執行程式碼