```r
freq_by_rank %>% 
  ggplot(aes(rank, `term frequency`, color = book)) + 
  geom_line(size = 1.1, alpha = 0.8, show.legend = FALSE) + 
  scale_x_log10() +
  scale_y_log10()
```

<div class="figure">
<img src="03-tf-idf_files/figure-epub3/zipf-1.png" alt="Zipf's law for Jane Austen's novels"  />
<p class="caption">(\#fig:zipf)Zipf's law for Jane Austen's novels</p>
</div>