```r
library(reshape2)

tidy_books %>%
  inner_join(get_sentiments("bing")) %>%
  count(word, sentiment, sort = TRUE) %>%
  acast(word ~ sentiment, value.var = "n", fill = 0) %>%
  comparison.cloud(colors = c("gray20", "gray80"),
                   max.words = 100)
```

<div class="figure">
<img src="02-sentiment-analysis_files/figure-epub3/wordcloud-1.png" alt="Most common positive and negative words in Jane Austen's novels"  />
<p class="caption">(\#fig:wordcloud)Most common positive and negative words in Jane Austen's novels</p>
</div>