title: Adding elements to a list in R (in nested lists)
body: <p>I have a nested list l3 as:</p>
  
  <pre><code>l1&lt;- as.list(c(1,2,3,4,5))
  l1
  
  l2&lt;- as.list(c(6,7,8,9,10))
  l2
  
  l3&lt;- list(l1,l2)
  l3
  </code></pre>
  
  <p>l3 shows as:</p>
  
  <pre><code>&gt; l3
  [[1]]
  [[1]][[1]]
  [1] 1
  
  [[1]][[2]]
  [1] 2
  
  [[1]][[3]]
  [1] 3
  
  [[1]][[4]]
  [1] 4
  
  [[1]][[5]]
  [1] 5
  
  
  [[2]]
  [[2]][[1]]
  [1] 6
  
  [[2]][[2]]
  [1] 7
  
  [[2]][[3]]
  [1] 8
  
  [[2]][[4]]
  [1] 9
  
  [[2]][[5]]
  [1] 10
  </code></pre>
  
  <p>I need to add a third list l4 to l3 such that l3 becomes:</p>
  
  <pre><code>[[1]][[1]]
      [1] 1
  
  to
  
  [[2]][[5]]
      [1] 10
  
  
  [[3]][[1]]
      [1] 30
  
  [[3]][[2]]
      [1] 32
  
  [[3]][[3]]
      [1] 33
  
  [[3]][[4]]
      [1] 34
  
  [[3]][[5]]
      [1] 35
  </code></pre>
  
  <p>where l4 was:</p>
  
  <pre><code>l4&lt;- as.list(c(31,32,33,34,35))
  </code></pre>
  
  <p>how do I accomplish it? I've tried <code>(c)</code>, <code>list</code>, even explicitly put the arguments and got an <code>out of bounds error</code>. What can I use to get this done?</p>