質問と回答をタグで結合する
questions と answers テーブルをより深く理解するために、question_tags テーブルを使って、投稿された各質問と提供された各回答に関連するタグを把握します。questions テーブルと answers テーブルそれぞれに対して、2 回の inner join を使ってこれらのテーブルを結合できます。
この演習はコースの一部です
dplyr で行うデータの結合
演習の手順
- 2 回の inner join を使って、
question_tagsとtagsテーブルをquestionsテーブルに結合します。 - 次に、2 回の inner join を使って、
question_tagsとtagsテーブルをanswersテーブルに結合します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Inner join the question_tags and tags tables with the questions table
questions %>%
inner_join(question_tags, by = ___) %>%
inner_join(tags, by = ___)
# Inner join the question_tags and tags tables with the answers table
answers %>%
___ %>%
___