워드클라우드 만들기
막대 그래프를 살펴봤으니, 이제 워드클라우드로 단어 빈도를 시각화해 볼까요? tidy_twitter는 이미 로드되고, 토큰화 및 정제가 완료되어 있어요.
이 연습은 강의의 일부입니다
R로 시작하는 텍스트 분석
연습 안내
wordcloud패키지를 로드하세요.- 단어 빈도를 계산해
word_counts에 할당하세요. word_counts에서 단어 열을words인수에 할당하세요.word_counts에서 빈도 열(n)을freq인수에 할당하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Load the wordcloud package
___(___)
# Compute word counts and assign to word_counts
word_counts <- ___ %>%
___(___)
wordcloud(
# Assign the word column to words
___ = ___,
# Assign the count column to freq
___ = ___,
max.words = 30
)