title: Removing list elements that have a specific name
body: <p>I've got a nested list and I need to remove all the nodes/elements that have a specific name. For example, in the following defined R list(), I'd like to remove all nodes that have the name 'lol'. I note that it can appear at different levels of the hierarchy.</p>
  
  <p>What's the best way to scan through the tree and remove those nodes?</p>
  
  <pre><code>tree &lt;- list(
      A = list(
          A_1 = list(
              A_1_1 = list(), A_1_2 = list()
          ),
          lol = "haha"
      ),
      B = list(
          B_1 = list(
              B_1_1 = list(), B_1_2 = list(), lol = "rofl"
          )
      )
  )
  </code></pre>
  
  <p>I'd like to perform some action on the tree object so that result becomes:</p>
  
  <pre><code>$A
  $A$A_1
  $A$A_1$A_1_1
  list()
  
  $A$A_1$A_1_2
  list()
  
  
  
  $B
  $B$B_1
  $B$B_1$B_1_1
  list()
  
  $B$B_1$B_1_2
  list()
  </code></pre>