title: Add new variable to list of data frames with purrr and mutate() from dplyr
body: <p>I know that there are <em>many</em> related questions here on SO, but I am looking for a purrr solution, please, not one from the apply list of functions or cbind/rbdind (I want to take this opportunity to get to know purrr better).  </p>
  
  <p>I have a list of dataframes and I would like to add a new column to each dataframe in the list. The value of the column will be the name of the dataframe, i.e. the name of each element in the list.  </p>
  
  <p>There is something similar <a href="https://stackoverflow.com/questions/37951756/recoding-similar-factor-levels-across-multiple-data-frames-using-purrr-and-dplyr">here</a>, but it involves the use of a function and <code>mutate_each()</code>, whereas I need just <code>mutate()</code>.  </p>
  
  <p>To give you an idea of the list (called <code>comentarios</code>), here is the first line of <code>str()</code> on the first element:</p>
  
  <pre><code>&gt; str(comentarios[1])
  List of 1
   $ 166860353356903_661400323902901:'data.frame':    13 obs. of  7 variables:
  </code></pre>
  
  <p>So I would like my new variable to contain <code>166860353356903_661400323902901</code> for 13 lines in the result, as an ID for each dataframe.  </p>
  
  <p>What I am trying is:  </p>
  
  <pre><code>dff &lt;- map_df(comentarios, 
                ~ mutate(ID = names(comentarios)),
                .id = "Group"
                )
  </code></pre>
  
  <p>However, <code>mutate()</code> needs the name of the dataframe in order to work:   </p>
  
  <pre><code>Error in mutate_(.data, .dots = lazyeval::lazy_dots(...)) : 
    argument ".data" is missing, with no default
  </code></pre>
  
  <p>It doesn't make sense to put in each name, I'd be straying into loop territory and losing the advantages of purrr (and R, more generally). If the list was smaller, I'd use <code>reshape::merge_all()</code>, but it has over 2000 elements. Thanks in advance for any help.  </p>
  
  <p><em>edit: some data to make the problem reproducible, as per alistaire's comments</em></p>
  
  <pre><code># install.packages("tidyverse")
  library(tidyverse)
  df &lt;- data_frame(one = rep("hey", 10), two = seq(1:10), etc = "etc")
  
  list_df &lt;- list(df, df, df, df, df)
  names(list_df) &lt;- c("first", "second", "third", "fourth", "fifth")
  dfs &lt;- map_df(list_df, 
                ~ mutate(id = names(list_df)),
                .id = "Group"
                )
  </code></pre>