```r
library(ggplot2)

not_words %>%
  mutate(contribution = n * score) %>%
  arrange(desc(abs(contribution))) %>%
  head(20) %>%
  mutate(word2 = reorder(word2, contribution)) %>%
  ggplot(aes(word2, n * score, fill = n * score > 0)) +
  geom_col(show.legend = FALSE) +
  xlab("Words preceded by \"not\"") +
  ylab("Sentiment score * number of occurrences") +
  coord_flip()
```

<div class="figure">
<img src="04-word-combinations_files/figure-epub3/notwordsplot-1.png" alt="The 20 words preceded by 'not' that had the greatest contribution to sentiment scores, in either a positive or negative direction"  />
<p class="caption">(\#fig:notwordsplot)The 20 words preceded by 'not' that had the greatest contribution to sentiment scores, in either a positive or negative direction</p>
</div>