title: File editing with awk or R, change a value if it is a duplicate
body: <p>I want to edit a file like the following.</p>
  
  <p>file structure, 3 columns</p>
  
  <pre><code> 1. 1 xy1 0
   2. 1 xy2 0
   3. 1 xy3 0.04
   4. 1 xy4 0.05
   5. 1 xy5 0.33
   6. 1 xy6 0.33
   7. 1 xy7 0.33
  </code></pre>
  
  <p>if a particular value in column 3 occurs twice or even several times (like "0" in line 1 und 2, and "0.33" in line 5,6 and 7) I want to edit the duplicate values. Everytime a value occured already I want to increase the duplicate value by 0.001. It would look like this:</p>
  
  <pre><code> 1. 1 xy1 0
   2. 1 xy2 0.001
   3. 1 xy3 0.04
   4. 1 xy4 0.05
   5. 1 xy5 0.33
   6. 1 xy6 0.331
   7. 1 xy7 0.332
  </code></pre>
  
  <p>The values in line 2, 6 and 7 were increased by 0.001.</p>
  
  <p>How can I do so using either awk/bash or R?
  I can identify the duplicates with "cut -f 3 file | sort | uniq -d", but how can I edit a value if it occured already in the list?</p>
  
  <p>I appreciate every hint, thanks in advance!</p>