```r
freq_by_rank %>% 
  ggplot(aes(rank, `term frequency`, color = book)) + 
  geom_abline(intercept = -0.62, slope = -1.1, color = "gray50", linetype = 2) +
  geom_line(size = 1.1, alpha = 0.8, show.legend = FALSE) + 
  scale_x_log10() +
  scale_y_log10()
```

![(\#fig:zipffit)Fitting an exponent for Zipf's law with Jane Austen's novels](03-tf-idf_files/figure-latex/zipffit-1.pdf)