flatten_stars: Flatten 5-Star Yelp Reviews to Positive/Negative

Description Usage Arguments Value

Description

This function takes integer Yelp star ratings and "flattens" them into binary positive/negative factor ratings. 1- and 2-star ratings become NEG, 4- and 5-star ratings become POS, and 3-star ratings are discarded.

Usage

1

Arguments

data

A tibble with Yelp reviews.

var

The column containing star ratings as numeric values between 1 and 5.

Value

A modified tibble without 3-star ratings, and with a new column containing "POS" for 4- and 5-star ratings and "NEG" for 1- and 2-star ratings.


chris31415926535/yelpredict documentation built on Jan. 7, 2021, 9:34 p.m.