Get Started

Adding custom stop words

We've seen a number of words in twitter_data that aren't informative and should be removed from your final list of words. In this exercise, you will add a few words to your custom_stop_words data frame .

This is a part of the course

“Introduction to Text Analysis in R”

View Course

Exercise instructions

  • The column names for the new data frame of custom stop words should match stop_words.
  • Add http, win, and t.co as custom stop words.
  • Row bind the custom stop words to stop_words.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

custom_stop_words <- tribble(
  # Column names should match stop_words
  ___, ___,
  # Add http, win, and t.co as custom stop words
  ___, "CUSTOM",
  ___, "CUSTOM",
  ___, "CUSTOM"
)

# Bind the custom stop words to stop_words
stop_words2 <- stop_words %>% 
  ___(___)

This exercise is part of the course

Introduction to Text Analysis in R

IntermediateSkill Level
4.6+
22 reviews

Analyze text data in R using the tidy framework.

While counts are nice, visualizations are better. In this chapter, you will learn how to apply what you know from ggplot2 to tidy text data.

Exercise 1: Plotting word countsExercise 2: Visualizing complaintsExercise 3: Visualizing non-complaintsExercise 4: Improving word count plotsExercise 5: Adding custom stop words
Exercise 6: Visualizing word counts using factorsExercise 7: Faceting word count plotsExercise 8: Counting by product and reorderingExercise 9: Visualizing word counts with facetsExercise 10: Plotting word cloudsExercise 11: Creating a word cloudExercise 12: Adding a splash of color

What is DataCamp?

Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.

Start Learning for Free