MulaiMulai sekarang secara gratis

Unnesting your data

As you've seen in the previous exercise, a nested data frame is simply a way to shape your data. Essentially taking the group_by() windows and packaging them in corresponding rows.

In the same way you can use the nest() function to break your data into nested chunks, you can use the unnest() function to expand the data frames that are nested in these chunks.

Latihan ini adalah bagian dari kursus

Machine Learning in the Tidyverse

Lihat Kursus

Petunjuk latihan

  • Use unnest() on the gap_nested data frame to take a nested column and expand it into a new data frame and save it as gap_unnested.
  • Make sure that gapminder and gap_unnested are identical by using the identical() function.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the unnested data frame called gap_unnnested
gap_unnested <- ___ %>% 
  ___(___)
  
# Confirm that your data was not modified  
identical(___, ___)
Edit dan Jalankan Kode