June 2017
Beginner to intermediate
576 pages
15h 22m
English
Market basket analysis using color choice analysis is an interesting topic in itself. However, for this analysis, we will remove some of the colors in order to simplify some of the descriptions. We will use the gsub() function to remove some of the specific colors that appear as part of the product description. Since the gsub() function only works on a single string or pattern at one time, set up a function to pass multiple strings to the gsub() function.
This gsub_multiple function will take a character vector (x), and change all strings supplied in from to their corresponding values in to. In our case, we want to eliminate them from the text, so our to strings will always be "":
gsub_multiple <- function(from, ...