НачатьНачать бесплатно

Splitting by multiple groups

gdp_by_industry_oceania contains the GDP generated by the agriculture and tourism industries in both 1995 and 2010. Your goal is to create a wide format data.table containing columns of GDP for each year and industry.

Это упражнение является частью курса

Joining Data with data.table in R

Посмотреть курс

Инструкции к упражнению

  • Print gdp_by_industry_oceania.
  • Convert gdp_by_industry_oceania to a wide format with each country as a row, splitting the "gdp" column so that the result has columns containing the gdp for each industry and each year.

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Split gdp by industry and year
___
Редактировать и запускать код