title: Use input of purrr's map function to create a named list as output in R
body: <p>I am using the map function of the purrr package in R which gives as output a list. Now I would like the output to be a named list based on the input. An example is given below.</p>
  
  <pre><code>input &lt;- c("a", "b", "c")
  output &lt;- purrr::map(input, function(x) {paste0("test-", x)})
  </code></pre>
  
  <p>From this I would like to access elements of the list using:</p>
  
  <pre><code>output$a
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>output$b
  </code></pre>