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

Melting a wide table

A data table named gdp_per_capita containing the gross domestic product (GDP) per capita for countries in Oceania every five years from 1990 to 2010 sourced from the Gapminder foundation is available in your workspace. Your goal is to reshape this data table to the long format so that there is a single column containing all GDP per capita values for each country and year.

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

Joining Data with data.table in R

ดูคอร์ส

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

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

# Print gdp_per_capita
___

# Reshape gdp_per_capita to the long format
___(___, ___)
แก้ไขและรันโค้ด