패싯으로 단어 빈도 시각화하기
이전 연습 문제에서 만든 word_counts가 로드되어 있어요. 불만 트윗과 일반 트윗을 각각 다른 패싯으로 나누어 Twitter 데이터의 단어 빈도를 시각화해 봅시다.
이 연습은 강의의 일부입니다
R로 시작하는 텍스트 분석
연습 안내
- 불만 트윗 여부에 따라 연결된 색상 미학을 포함하세요.
- 막대 그래프의 범례는 표시하지 마세요.
- 트윗이 불만에서 왔는지 여부로 패싯을 나누고, y축은 자유롭게 설정하세요.
- 좌표를 뒤집고 제목을 추가하세요: "Twitter Word Counts".
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Include a color aesthetic tied to whether or not its a complaint
ggplot(word_counts, aes(x = word2, y = n, ___)) +
# Don't include the lengend for the column plot
geom_col(___) +
# Facet by whether or not its a complaint and make the y-axis free
___(___, scales = ___) +
# Flip the coordinates and add a title: "Twitter Word Counts"
___() +
___(___)