title: Using dplyr to group the new calculations into one data frame
body: <p>I have the following table and I have to obtain a standard deviation of y for each <strong>unique</strong> value of x.</p>
  <pre><code>  ID    x   y
  
     1    1   4   
     2    2   3   
     3    3   7   
     4    1   2   
     5    2   6   
     6    3   8   
  </code></pre>
  <p>For example, each unique value of x, I have y=4 and y=2, so the standard deviation will be:</p>
  <pre><code>x1 &lt;- c(4,2)
  sd(x1) 
  #output is 1.41
  
  x2 &lt;-c(3,6)
  sd(x2)
  #output is 2.21
  
  x3 &lt;-c(3,6)
  sd(x3)
  #output is 0.71
  </code></pre>
  <p>Instead of getting each output and put it in a data frame using the long way, is there a way to do it faster using dplyr and the pipe? I tried to use mutate and group_by, but it doesn't seem to work. I would like the result to look the following with count_y (# of y values to each unique x)</p>
  <pre><code>x   count_y  Std_Dev
      
  1   2        1.41
  2   2        2.21
  3   2        0.71
  </code></pre>