LoslegenKostenlos loslegen

Left joining a table to itself

So far, you've been inner joining a table to itself in order to find the children of themes like "Harry Potter" or "The Lord of the Rings".

But some themes might not have any children at all, which means they won't be included in the inner join. As you've learned in this chapter, you can identify those with a left_join and a filter().

Diese Übung ist Teil des Kurses

Joining Data with dplyr

Kurs anzeigen

Anleitung zur Übung

  • Left join the themes table to its own children, with the suffixes _parent and _child respectively.
  • Filter the result of the join to find themes that have no children.

Interaktive Übung

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

themes %>% 
  # Left join the themes table to its own children
  ___ %>%
  # Filter for themes that have no child themes
  filter(___)
Code bearbeiten und ausführen