How to use gsub for the list of multiple patterns in R
<p>This is kind of hard to explain, so please bear with me.</p>

<p>I would like to do a "find/replace" using a list of strings to "find" and an empty string ("") to replace. I have a large data table column I'd like to do this find/replace on. </p>

<p>Using base R, I can't figure out how to use a pattern list in gsub.</p>

<p>I have made a loop, but if someone could help me figure out how to use one of the apply functions (or something else in just base R), that would be MUCH more efficient and I would greatly appreciate it.</p>

<p>This works, but takes SO long:</p>

<pre><code>for(i in 1:GarbMax){
      Table.All$Cleaned&lt;-gsub(garbage[i], "", Table.All$Cleaned, ignore.case = TRUE, fixed = TRUE)
}
</code></pre>

<p>The list of values I'd like to find are in "garbage", the field I'm looking for them in is "Table.All$Cleaned". "GarbMax" is just the max value of the "garbage" list.</p>

<p>As an aside (maybe), the above code gives me a warning that ignore.case=TRUE is being ignored. Any idea why?</p>

<p>Thanks so much for your help!</p>