title: Looping gsub() replacing elements from a list of multiple words into a corpus
body: <p>I have a corpus of 233 documents (<strong>ecb_corpus</strong>) and a list of multiwords (<strong>ecb_final</strong>). I want to replace every brigram and trigram in my multiwords list into my corpus.</p>
  
  <p>This is my multiwords list:</p>
  
  <pre><code>1   euro_area
  2   monetary_policy
  3   price_stability
  4   interest_rates
  5   second_question
  6   medium_term
  7   first_question
  8   central_banks
  9   inflation_expectations
  10  structural_reforms
  </code></pre>
  
  <p>I just managed to do it for one single case by using <strong><em>gsub</em></strong>: </p>
  
  <pre><code>ecb_ready &lt;- gsub(pattern = "interest rate", replacement= "interest_rates", ecb_corpus, ignore.case = TRUE, perl = FALSE, fixed = TRUE)
  </code></pre>
  
  <p>To get the results I want, in <em>pattern</em> there should be any word of the corpus (<strong>ecb_corpus</strong>) and in <em>replacement</em> my list of multiwords (<strong>ecb_final</strong>). I have been trying completely unsuccessfully loops (quite new to R and not able yet to do them unfortunately).</p>
  
  <p>Is there anyone who can help me loop it?</p>
  
  <p>Thanks a lot!</p>