title: Defining names of list elements
body: <p>Let's consider vector of names for the elements of my list:</p>
  <pre><code>name_vec &lt;- c(&quot;name&quot;, &quot;of&quot;, &quot;the&quot;, &quot;list&quot;, &quot;elements&quot;)
  </code></pre>
  <p>This vector contains names of the elements of the list. Let's define an empty list and name each element with elements from <code>name_vec</code></p>
  <pre><code>my_list &lt;- list()
  
  for (i in seq_len(length(name_vec))) { 
    my_list[[name_vec[i]]] &lt;- i+1
  }
  </code></pre>
  <p>However I find this solution highly inefficient due to fact that loop was used. I think that has to be some way to avoid it but I'm not aware of it. Tried to do something with <code>lapply</code> but it lead's me to nothing. Do you have any ideas how it can be done ?</p>