title: Percentile in list
body: <p>I have the following list (h):</p>
  
  <pre><code>&gt; h
  [[1]]
  [1] 0.9613971
  
  [[2]]
  [1] 0.9705882
  
  [[3]]
  [1] 0.9503676
  
  [[4]]
  [1] 0.9632353
  
  [[5]]
  [1] 0.9779412
  
  [[6]]
  [1] 0.9852941
  
  [[7]]
  [1] 0.9852941
  
  [[8]]
  [1] 0.9816176
  </code></pre>
  
  <p>I would like to add a new column that will calculate the percentile of each number in the list.
  I tried to use the following and I get errors:</p>
  
  <pre><code>perc.rank &lt;- function(x, xo)  length(x[x &lt;= xo])/length(x)*100
  
  
  perc.rank &lt;- function(x) trunc(rank(x))/length(x)
  
  trunc(rank(h))/length(h)
  </code></pre>
  
  <p>In addition, I would to know given a number such as 0.9503676 (the third number) or its number (3) how can I know what is his percentile?</p>