title: How do I rename files using R?
body: <p>I have over 700 files in one folder named as:
  files from number 1 to number9 are named for the first month:</p>
  
  <pre><code>water_200101_01.img  
  water_200101_09.img  
  </code></pre>
  
  <p>files from number 10 to number30 are named:</p>
  
  <pre><code>water_200101_10.img
  water_200101_30.img
  </code></pre>
  
  <p>And so on for the second month:
  files from number 1 to number9 are named:</p>
  
  <pre><code>water_200102_01.img  
  water_200102_09.img  
  </code></pre>
  
  <p>files from number 10 to number30 are named:</p>
  
  <pre><code>water_200102_10.img
  water_200102_30.img 
  </code></pre>
  
  <p>How can I rename them without making any changes to the files. just change the nams, for example    </p>
  
  <pre><code>water_1
  water_2
  ...till...
  water_700
  </code></pre>