title: text mining with R: how to see positive-negative sentiments in my document?
body: <p>I am new to R. I have found the number of positive-negative words (953 negative, 458 positive) in my document, but I want to see these words. How can I do it? </p>
  
  <pre><code>library(readr)
  library(tidyverse)
  library(tidytext)
  library(glue)
  library(stringr)
  library(dplyr)
  davos &lt;- read_file("davos.txt")
  fileText &lt;- glue(read_file(davos))
  fileText &lt;- gsub("\\$", "", fileText)
  tokens &lt;- data_frame(text = fileText) %&gt;% unnest_tokens(word, text)
  tokens %&gt;% inner_join(get_sentiments("bing")) %&gt;% count(sentiment) %&gt;% spread(sentiment, n, fill = 0) %&gt;% mutate(sentiment = positive - negative)
  
  # Joining, by = "word"
  #
  # # A tibble: 1 x 3
  #     negative positive sentiment
  #        &lt;dbl&gt;    &lt;dbl&gt;     &lt;dbl&gt;
  #   1     953.     458.     -495.
  </code></pre>