title: r How do I rescale a range of numbers with these constraints?
body: <p>I need to rescale a series of numbers with certain constraints.</p>
  <p>Let's say I have a vector like this:</p>
  <p><code>x &lt;- c(0.5, 0.3, 0.6, 0.4, 0.9, 0.1, 0.2, 0.3, 0.6)</code></p>
  <ol>
  <li>The sum of x must be 6. Right now the sum of x = 3.9.</li>
  <li>The numbers cannot be lower than 0</li>
  <li>The numbers cannot be higher than 1</li>
  </ol>
  <p>I know how to do 1 and 2+3 separately, but not together.
  How do I rescale this?</p>
  <p>EDIT: As was tried by r2evans, preferably the relative relationships of the numbers is preserved</p>