title: Add jitter to column value using dplyr
body: <p>I have a data frame of the following format.</p>
  
  <pre><code>   author year stages
  1  A 1150      1
  2  B 1200      1
  3  C 1200      1
  4  D 1300      1
  5  D 1300      1
  6  E 1390      3
  7  F 1392      3
  8  G 1400      3
  9  G 1400      3
  ...
  </code></pre>
  
  <p>I want to jitter each year and author combination by a small amount. I want documents by different authors in the same year to be jittered by unique values. For example, tokens from author B and C appear in the same year, but should be jittered by different amounts. All tokens from the same author, for example the two tokens from author G at 1400 should be jittered by the same amount.</p>
  
  <p>I've tried the following, but get a unique jitter amount for each and every row.</p>
  
  <pre><code>data %&gt;% group_by(author) %&gt;% mutate(year = jitter(year, amount=.5))
  </code></pre>
  
  <p>The output of this code is the following.</p>
  
  <pre><code>   author     year stages
  1  A 1150.400      1
  2  B 1200.189      1
  3  C 1200.222      1
  4  D 1300.263      1
  5  D 1299.788      1
  6  E 1390.045      3
  7  F 1391.964      3
  8  G 1399.982      3
  9  G 1399.783      3
  </code></pre>
  
  <p>However, I would like the following, where both tokens from author G should be shifted by the same amount. The crucial difference is that for author G all tokens are shifted by the same amount.</p>
  
  <pre><code>   author     year stages
  1  A 1150.400      1
  2  B 1200.189      1
  3  C 1200.222      1
  4  D 1300.263      1
  5  D 1299.788      1
  6  E 1390.045      3
  7  F 1391.964      3
  8  G 1399.982      3
  9  G 1399.982      3
  </code></pre>