LoslegenKostenlos loslegen

Joining themes to their children

Tables can be joined to themselves!

In the themes table, which is available for you to inspect in the console, you'll notice there is both an id column and a parent_id column. Keeping that in mind, you can join the themes table to itself to determine the parent-child relationships that exist for different themes.

In the videos, you saw themes joined to their own parents. In this exercise, you'll try a similar approach of joining themes to their own children, which is similar but reversed. Let's try this out to discover what children the theme "Harry Potter" has.

Diese Übung ist Teil des Kurses

Joining Data with dplyr

Kurs anzeigen

Anleitung zur Übung

  • Inner join themes to their own children, resulting in the suffixes "_parent" and "_child", respectively.
  • Filter this table to find the children of the "Harry Potter" theme.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

themes %>% 
  # Inner join the themes table
  ___ %>%
  # Filter for the "Harry Potter" parent name 
  ___
Code bearbeiten und ausführen