배트맨과 스타워즈 LEGO 부품 전체 조인하기
이제 batman 테마와 star_wars 테마에 있는 부품을 각각 별도의 테이블로 만들었으니, 두 테마의 공통점과 차이점을 살펴볼 수 있도록 이를 결합해 보겠습니다. 이전 연습 문제에서의 집계 결과는 batman_parts와 star_wars_parts로 저장되어 있으며, 미리 로드되어 있습니다.
batman_parts <- batman %>%
count(part_num, color_id, wt = quantity)
star_wars_parts <- star_wars %>%
count(part_num, color_id, wt = quantity)
이 연습은 강의의 일부입니다
dplyr로 데이터 결합하기
연습 안내
star_wars_parts테이블을batman_parts테이블과 결합하세요. 접미사 인수로"_batman"및"_star_wars"를 사용하세요.n_batman및n_star_wars열의 NA 값을 모두 0으로 바꾸세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
batman_parts %>%
# Combine the star_wars_parts table
___ %>%
# Replace NAs with 0s in the n_batman and n_star_wars columns
___