title: List index by number and some element NULL,how to convert to data frame?
body: <p>In R program, the list length is unknow.It is generated from for loop.
  for example:</p>
  
  <pre><code>ls &lt;- list()
  ls[[1]] &lt;- 5
  ls[[3]] &lt;- a
  ls[[6]] &lt;- 8
  ....
  </code></pre>
  
  <p>Some index(ordinal number) is undefined.</p>
  
  <p>I want to convert to data frame, such as follows:</p>
  
  <pre><code>1  5
  2  NA
  3  a
  4  NA
  5  NA
  6  8
  ...
  </code></pre>
  
  <p>Additional question: how to get the ordinal number range of this list?</p>