MulaiMulai sekarang secara gratis

Nesting your data

In this course, you will work with a collection of economic and social indicators for 77 countries over a period of 52 years. This data is stored in the gapminder data frame.

In this exercise, you will transform your gapminder data into a nested data frame by using the first tool needed to build the foundation of tidy machine learning skills: nest().

Note: This is a more granular version than the dataset available from the gapminder package. This version is available in the dslabs package.

Latihan ini adalah bagian dari kursus

Machine Learning in the Tidyverse

Lihat Kursus

Petunjuk latihan

  • Take a look at the first six rows of gapminder.
  • Now leverage group_by() and nest() to nest your data frames by country, save this as gap_nested.
  • Explore the first six rows of the newly created data frame gap_nested, note the new complex column data containing tibbles.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Explore gapminder
head(___)

# Prepare the nested data frame gap_nested
library(tidyverse)
gap_nested <- gapminder %>% 
  group_by(___) %>% 
  ___()

# Explore gap_nested
head(___)
Edit dan Jalankan Kode