title: Replacing elements in a list of lists
body: <p>The <code>apply</code> functions in R are a nice way to simplify for loops to get to an output. Is there an equivalent function that helps one avoid for loops when replacing the values of a vector? This is better understood by example...</p>
  
  <pre><code># Take this list for example
  x = list( list(a=1,b=2), list(a=3,b=4), list(a=5,b=6) )
  
  # To get all of the "a" elements from each list, I can do
  vapply(x,"[[",1,"a")
  [1] 1 3 5
  
  # If I want to change all of the "a" elements, I cannot do
  vapply(x,"[[",1,"a") = 10:12
  Error in vapply(x, "[[", 1, "a") = 10:12 : 
    could not find function "vapply&lt;-"
  # (this error was expected)
  
  # Instead I must do something like this...
  new.a = 10:12
  for(i in seq_along(x)) x[[i]]$a = new.a[i]
  </code></pre>
  
  <p>Is there a simpler or faster alternative to using a loop?</p>