title: how to get the indices of values by the quantile?
body: <p>For example if my data looks like this:</p>
  
  <pre><code>&gt; a &lt;- c(1:25)
  &gt; a
  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  </code></pre>
  
  <p>How do i get a list like this:</p>
  
  <pre><code>1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 
  </code></pre>
  
  <p><strong>So I want to divide the 25 elements in to 5 sublists, and find out the index of the sublist that each element belongs to. Data is not sorted and is too large to sort. There are also missing values, in which case their index would be 0.</strong></p>
  
  <p><strong>Sorry, to clarify, I dont need the groups to have equal sizes, but they need to be divided by the 0.2, 0.4, 0.6, 0.8 quantiles.</strong></p>
  
  <p>i.e. the ith element in my output should be the nth quantile that the ith element in a belongs to. For example, 8 is in the second quantile, the 8th element in my output is 2.</p>