title: Trouble Understanding %>%
body: <p>I am having a huge amount of trouble understanding %&gt;%</p>
  <p>I need an example to understand this. Here is my simple example:</p>
  <pre><code>v &lt;- c(&quot;the cat the cat ran up the tree tree&quot;, &quot;the dog ran up the up the tree&quot;, 
           &quot;the squirrel squirrel ran up the tree&quot;)
  </code></pre>
  <p>The desired output is:</p>
  <pre><code>&quot;the cat ran up the tree&quot;
  &quot;the dog ran up the tree&quot;
  &quot;the squirrel ran up the tree&quot;
  </code></pre>
  <p>I wish to take:</p>
  <pre><code>v &lt;- gsub('kat', 'cat', v) 
  v &lt;- gsub('dogg', 'dog', v) 
  v &lt;- gsub('squirrel', 'squirrrel', v)
  </code></pre>
  <p>And use:</p>
  <pre><code>gsub('kat', 'cat', v) %&gt;%
  gsub('dogg', 'dog', v) %&gt;%
  gsub('squirrel', 'squirrrel', v)
  </code></pre>
  <p>Can someone correct this for me?</p>
  <p>I get the error:</p>
  <pre><code>Warning message:
  In gsub(., &quot;dogg&quot;, &quot;dog&quot;, v) :
    argument 'pattern' has length &gt; 1 and only the first element will be used
  </code></pre>