เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Casting a long table

gdp_oceania contains the population and GDP for every country in Oceania for every five years from 1990 to 2010 and is available in your workspace. Your goal is to create wide format data.tables containing the population and total GDP for each country with each year having its own column.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Joining Data with data.table in R

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Split the population column by year
___(gdp_oceania, formula = ___ ~ ___, value.var = "population")
แก้ไขและรันโค้ด