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.
Bu egzersiz
Machine Learning in the Tidyverse
kursunun bir parçasıdırEgzersiz talimatları
- Take a look at the first six rows of
gapminder. - Now leverage
group_by()andnest()to nest your data frames bycountry, save this asgap_nested. - Explore the first six rows of the newly created data frame
gap_nested, note the new complex column data containing tibbles.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Explore gapminder
head(___)
# Prepare the nested data frame gap_nested
library(tidyverse)
gap_nested <- gapminder %>%
group_by(___) %>%
___()
# Explore gap_nested
head(___)