시작하기무료로 시작하기

Frequent terms with qdap

If you are OK giving up some control over the exact preprocessing steps, then a fast way to get frequent terms is with freq_terms() from qdap.

The function accepts a text variable, which, in our case, is the tweets$text vector. You can specify the top number of terms to show with the top argument, a vector of stop words to remove with the stopwords argument, and the minimum character length of a word to be included with the at.least argument. qdap has its own list of stop words that differ from those in tm. Our exercise will show you how to use either and compare their results.

Making a basic plot of the results is easy. Just call plot() on the freq_terms() object.

이 연습은 강의의 일부입니다

Text Mining with Bag-of-Words in R

강의 보기

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Create frequency
frequency <- ___(
  ___, 
  top = ___, 
  at.least = ___, 
  stopwords = ___
)

# Make a frequency bar chart
코드 편집 및 실행