Joining question and answer counts
We can also determine how many questions actually yield answers. If we count the number of answers for each question, we can then join the answers counts with the questions table.
Bu egzersiz
Joining Data with dplyr
kursunun bir parçasıdırEgzersiz talimatları
- Count and sort the
question_idcolumn in theanswerstable to create theanswer_countstable. - Join the
questionstable with theanswer_countstable and include all observations from thequestionstable. - Replace the NA values in the
ncolumn with 0s.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Count and sort the question id column in the answers table
answer_counts <- answers %>%
___
# Combine the answer_counts and questions tables
questions %>%
___ %>%
# Replace the NAs in the n column
___