title: Extract names of deeply nested lists
body: <p>Suppose I have a list like this :</p>
  
  <pre><code>m &lt;- list('a' = list('b' = c(1, 2), 'c' = 3, 'b1' = 4))
  </code></pre>
  
  <p>I want to get the names of <code>m</code> and maintain the levels also.</p>
  
  <p>If I do</p>
  
  <pre><code>names(unlist(m))
  </code></pre>
  
  <p>It gives output</p>
  
  <pre><code>"a.b1" "a.b2" "a.c"  "a.b1"
  </code></pre>
  
  <p>But I want only names like</p>
  
  <pre><code>"a.b" "a.c" "a.b1"
  </code></pre>
  
  <p>How to get that ?</p>
  
  <p>Also <code>unlist()</code> is a costly operation for big nested lists. Is there any way to do it without <code>unlist()</code> and in a faster way ?</p>
  
  <pre><code>Example 2 : 
  
  p = list( 'a' = list( 'z' = c( 1, 2 ), 'g' = list( 'i' = 2, 'j' = 3 ) ), 'd'    = list( 'k' = c( 4, 5 ) ) )
  
  Example 3 :
  
  p = list( 'a' = list( 'z' = c( 1, 2 ), 'g' = list( 2, 3 ) ), 'd' = list( 'k' = c( 4, 5 ) ) )
  </code></pre>