Exercise

Isolate Indian restaurants

You may have noticed from the previous exercise, the data set rub is large and covers many genres of cuisine. It makes sense to compare restaurants of similar cuisine for obvious reasons, so in order to simplify the task of adapting Yelp reviews, you will only look at reviews for Indian restaurants. The modifications in this course will serve as a case study of how you could adapt other reviews from the various types of food that also exist on Yelp.

With that said, you need to filter out all of the non-Indian reviews. To do this you will use a combination of grepl() and subset() to create a binary true/false column indicating whether that review was for an Indian restaurant. This column will allow you to filter out all reviews that are not for Indian restaurants.

Instructions

100 XP
  • Create binary true/false column is_indian for Indian-only restaurant reviews using grepl() and the categories column.
  • Use subset() to filter out all non-Indian reviews and assign the remaining reviews to data frame indian.