title: Define names of objects in multiple lists within a list (using lapply?)
body: <p>My apologies for the somewhat confusing title (any suggestion for improvement are welcome).. </p>
  
  <p>Suppose I have a list which contains several (e.g. four) lists in which I would like to store 20 objects later on:</p>
  
  <pre><code>mylist &lt;- vector(mode="list",length=4)
  names(mylist) &lt;- c("One","Two","Three","Four")
  mylist$One &lt;- mylist$Two &lt;- mylist$Three &lt;- mylist$Four &lt;- vector(mode="list",
                                                                    length=20)
  </code></pre>
  
  <p>I would like to define the names of those objects beforehand. Of course, I can do that as following:</p>
  
  <pre><code> names(mylist$One) &lt;- c("A","B","C","D","E","F","G","H","I","J",
                          "K","L","M","N","O","P","Q","R","S","T")
  
   names(mylist$Two) &lt;- names(mylist$Three) &lt;- names(mylist$Four) &lt;- names(mylist$One) 
  </code></pre>
  
  <p>But if the number of the lists would increase (as is the case in my actual data), this becomes rather cumbersome, so I was trying to do this with a function such as <code>lapply</code> :</p>
  
  <pre><code>mylist &lt;- lapply(mylist,FUN=function(x) {names(x) &lt;-   
                          c("A","B","C","D","E","F","G","H","I","J",
                            "K","L","M","N","O","P","Q","R","S","T")})
  </code></pre>
  
  <p>This, however, does not give me the same result, but I can not seem to figure out what I am overlooking here. Any suggestions? </p>
  
  <p>Thanks!</p>