title: R - Drawing a random ordered sample
body: <p>In R, I currently have the following code:</p>
  
  <pre><code>    sample(1:15,sample(1:15,1))
  </code></pre>
  
  <p>This draws values of random size in a randomized order. However, for my application, the order must be kept the same. </p>
  
  <p>I cannot simply order the values after each draw as this is computationally inefficient. For my application, I would like to draw from a sample of ordered values, which will greatly reduce the sample size and thus the computation time.</p>
  
  <p>Some examples:</p>
  
  <pre><code>    &gt; 7 9 13 14
      &gt; 1 5 6
      &gt; 3 4 8 10 11 14 15
      &gt; 2
      &gt; 2 4 6 8 9
  </code></pre>
  
  <p>EDIT: Each value in the draw must also be unique.</p>