Unirea numărului de întrebări și răspunsuri
Putem determina și câte întrebări primesc efectiv răspunsuri. Dacă numărăm răspunsurile pentru fiecare întrebare, putem apoi uni numărul de răspunsuri cu tabela questions.
Acest exercițiu face parte din cursul
Joining Data with dplyr
Instrucțiuni pentru exercițiu
- Numără și sortează coloana
question_iddin tabelaanswerspentru a crea tabelaanswer_counts. - Unește tabela
questionscu tabelaanswer_countsși include toate observațiile din tabelaquestions. - Înlocuiește valorile NA din coloana
ncu 0.
Exercițiu interactiv practic
Încearcă acest exercițiu completând acest cod de exemplu.
# 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
___