title: Divide numbers into equally-spaced intervals ranging between 0-1
body: <p>Suppose I have this series of numbers in a vector:</p>
  <pre><code>vec &lt;- c(1,2,3,4,5)           # just an example, numbers could be far higher
  </code></pre>
  <p>How can I programmatically divide these numbers into equally-spaced intervals ranging between <code>0-1</code>, such that I get:</p>
  <p>for</p>
  <ul>
  <li>1: <code>0</code></li>
  <li>2: <code>0, 1</code></li>
  <li>3: <code>0, 0.5, 1</code></li>
  <li>4: <code>0, 0.33, 0.66, 1</code></li>
  <li>5: <code>0, 0.25, 0.50, 0.75, 1</code></li>
  <li>and so on.</li>
  </ul>
  <p>Any idea?</p>