title: Replace values in character vector using lookup table in R
body: <p><br>
  I have something like this:</p>
  
  <pre><code>  #Change deg
    x1 &lt;- gsub("&amp;deg;","°",x1)
  
    #Change ohm
    x1 &lt;- gsub("&amp;ohm;","Ω",x1)
  
    #change divide
    x1 &lt;- gsub("&amp;divide;","÷",x1)
  
    #change minus
    x1 &lt;- gsub("&amp;minus;","-",x1)
  </code></pre>
  
  <p>But there are many values and I do not want to write everything in the r script. I have a table where it looks like this</p>
  
  <pre><code>&amp;newtonm;   N m 
  &amp;reg;   ®
  &amp;deg;   °
  &amp;minus; -
  </code></pre>
  
  <p>How do i lookup the table and make the changes in the R script? </p>