Juntar contagens de perguntas e respostas
Também podemos determinar quantas perguntas realmente geram respostas. Se contarmos o número de respostas para cada pergunta, poderemos juntar as contagens de respostas com a tabela questions.
Este exercício faz parte do curso
Unindo dados com o dplyr
Instruções do exercício
- Conte e classifique a coluna
question_idna tabelaanswerspara criar a tabelaanswer_counts. - Junte a tabela
questionscom a tabelaanswer_countse inclua todas as observações da tabelaquestions. - Substitua os valores de NA na coluna
npor 0s.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# 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
___