질문과 답변 개수 조인하기
실제로 몇 개의 질문이 답변을 받았는지도 확인할 수 있어요. 각 질문별 답변 수를 계산한 다음, 그 답변 개수를 questions 테이블과 조인해 봅시다.
이 연습은 강의의 일부입니다
dplyr로 데이터 결합하기
연습 안내
answers테이블에서question_id열을 집계하고 정렬하여answer_counts테이블을 만드세요.questions테이블의 모든 행을 포함하도록answer_counts와 조인하세요.n열의 NA 값을 0으로 바꾸세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# 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
___