title: argument 'pattern' has length > 1 and only the first element will be used - GSUB()
body: <p>I have the following problem.</p>
  <pre><code>table &lt;- data.frame(col1 = c(&quot;cars1 gm&quot;, &quot;cars2 gl&quot;), col2 = c(&quot;cars1 motor mel&quot;, &quot;cars2 prom del&quot;))
  
        col1            col2
  1 cars1 gm cars1 motor mel
  2 cars2 gl  cars2 prom del
  
  table$word &lt;- gsub(table$col1, ' ', table$col2) 
  
  Warning message:  In gsub(table$col1, &quot; &quot;, table$col2) :  argument
  'pattern' has length &gt; 1 and only the first element will be used
  </code></pre>
  <p>How do I create a new column called <code>word</code> containing only those values of <code>col2</code> which do not appear in <code>col1</code>?</p>
  <pre><code>      col1            col2       word
  1 cars1 gm cars1 motor mel  motor mel
  2 cars2 gl  cars2 prom del   prom del
  </code></pre>