LoslegenKostenlos loslegen

Joining questions, answers, and tags

Let's build on the last exercise by adding the tags table to our previous joins. This will allow us to do a better job of identifying which R topics get the most traction on Stack Overflow. The tables you created in the last exercise have been preloaded for you as answer_counts and question_answer_counts.

answer_counts <- answers %>%
    count(question_id, sort = TRUE)

question_answer_counts <- questions %>%
    left_join(answer_counts, by = c("id" = "question_id")) %>%
    replace_na(list(n = 0))

Diese Übung ist Teil des Kurses

Joining Data with dplyr

Kurs anzeigen

Anleitung zur Übung

  • Combine the question_tags table with question_answer_counts using an inner_join.
  • Now, use another inner_join to add the tags table.

Interaktive Übung

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

question_answer_counts %>%
  # Join the question_tags tables
  ___ %>%
  # Join the tags table
  ___
Code bearbeiten und ausführen