title: Filter values from list in R
body: <p>I want to calculate the mean of a list of named numbers. There are <code>numeric(0)</code> values that I first want to remove.  Also, I would like to retrieve which elements of the list contain <code>numeric(0)</code> values.</p>
  
  <p>Here is an example how the values could look like:</p>
  
  <pre><code>&gt;r["gg",]
  
  $`01_1_er`
     gg 
  0.5176445 
  
  $`02_1_er`
     gg 
  0.4990959 
  
  $`03_1_er`
     gg 
  0.5691489 
  
  $`22_1_er`
  numeric(0)
  
  $`23_1_er`
  numeric(0)
  
  $`25_1_er`
    gg 
  0.386304 
  </code></pre>
  
  <p>And here is the result of str:</p>
  
  <pre><code>&gt; str(r["gg",])
  List of 6
   $ 01_1_er: Named num 0.518
    ..- attr(*, "names")= chr "gg"
   $ 02_1_er: Named num 0.499
    ..- attr(*, "names")= chr "gg"
   $ 03_1_er: Named num 0.569
    ..- attr(*, "names")= chr "gg"
   $ 22_1_er: num(0) 
   $ 23_1_er: num(0) 
   $ 25_1_er: Named num 0.386
    ..- attr(*, "names")= chr "gg"
  </code></pre>
  
  <p>Can anyone help?</p>