title: How to assign a value to a data.frame filtered by dplyr?
body: <p>I am trying to modify a data.frame filtered by dplyr but I don't quite seem to grasp what I need to do. In the following example, I am trying to filter the data frame z and then assign a new value to the third column -- I give two examples, one with "9" and one with "NA".</p>
  
  <pre><code>require(dplyr)
  z &lt;- data.frame(w = c("a", "a", "a", "b", "c"), x = 1:5, y = c("a", "b", "c", "d", "e"))
  z %&gt;% filter(w == "a" &amp; x == 2) %&gt;% select(y) 
  z %&gt;% filter(w == "a" &amp; x == 2) %&gt;% select(y) &lt;- 9 # Should be similar to z[z$w == "a" &amp; z$ x == 2, 3] &lt;- 9
  z %&gt;% filter(w == "a" &amp; x == 3) %&gt;% select(y) &lt;- NA # Should be similar to z[z$w == "a" &amp; z$ x == 3, 3] &lt;- NA
  </code></pre>
  
  <p>Yet, it doesn't work: I get the following error message: </p>
  
  <blockquote>
    <p>"Error in z %>% filter(w == "a" &amp; x == 3) %>% select(y) &lt;- NA : impossible de trouver la fonction "%>%&lt;-"</p>
  </blockquote>
  
  <p>I know that I can use the old data.frame notation, but what would be the solution for dplyr?</p>
  
  <p>Thanks!</p>