title: Using the Nested List Column Approach and Purrr Together with Tidytext::Unnest_Tokens
body: <p>I have a dataframe that contains survey responses with each row representing a different person. One column - "Text" - is an open-ended text question. I would like to use Tidytext::unnest_tokens so that I do text analysis by each row, including sentiment scores, word counts, etc.   </p>
  
  <p>Here is the simple dataframe for this example:</p>
  
  <pre><code>Satisfaction&lt;-c ("Satisfied","Satisfied","Dissatisfied","Satisfied","Dissatisfied")
  Text&lt;-c("I'm very satisfied with the services", "Your service providers are always late which causes me a lot of frustration", "You should improve your staff training, service providers have bad customer service","Everything is great!","Service is bad")
  Gender&lt;-c("M","M","F","M","F")
  df&lt;-data.frame(Satisfaction,Text,Gender)
  </code></pre>
  
  <p>I then turned the Text column into character...</p>
  
  <pre><code>df$Text&lt;-as.character(df$Text)
  </code></pre>
  
  <p>Next I grouped by the id column and nested the dataframe. </p>
  
  <pre><code>df&lt;-df%&gt;%mutate(id=row_number())%&gt;%group_by(id)%&gt;%unnest_tokens(word,Text)%&gt;%nest(-id)
  </code></pre>
  
  <p>Getting this far seems to have worked ok, but now how do I use purrr::map functions to work on the nested list column "word"? For example, if I want to create a new column using dplyr::mutate with word counts for each row? </p>
  
  <p>Also, is there a better way to nest the dataframe so that only the "Text" column is a nested list?</p>