Errors and updates

Chapman and Hall/CRC published this book in July 2023. You can purchase that here.

This online version has some updates to what was printed. An online version that matches the print version is available here.

Last updated: 15 October 2024.

The book was reviewed by Piotr Fryzlewicz in The American Statistician (Fryzlewicz 2024) and Nick Cox on Amazon. I am grateful they gave such a lot of their time to provide the review, as well as their corrections and suggestions.

Since the publication of this book in July 2023, there have been a variety of changes in the world. The rise of generative AI has changed the way that people code, Python has become easier to integrate alongside R because of Quarto, and packages continue to update (not to mention a new cohort of students has started going through the book). One advantage of having an online version is that I can make improvements.

I am grateful for the corrections and suggestions of: Andrew Black, Clay Ford, Crystal Lewis, David Jankoski, Donna Mulkern, Emi Tanaka, Emily Su, Inessa De Angelis, James Wade, Julia Kim, Krishiv Jain, Seamus Ross, Tino Kanngiesser, and Zak Varty.

Errors

The following errors exist in the print version, but have been updated in the online version. If you notice an error not mentioned below, please submit an issue or send an email: rohan.alexander@utoronto.ca.

  • p. xxi: Add Alex Hayes to the Acknowledgments.
  • p. 20: Add “packages” to “use the tidyverse and janitor packages.”
  • p. 34: "daily-shelter-overnight-service-occupancy-capacity-2021" should be "daily-shelter-overnight-service-occupancy-capacity-2021.csv" (note the “.csv” added).
  • p. 34: Replace the first code chunk with the second:
toronto_shelters_clean <-
     clean_names(toronto_shelters) |>
     select(occupancy_date, id, occupied_beds)

head(toronto_shelters_clean)
toronto_shelters_clean <-
  clean_names(toronto_shelters) |>
  mutate(occupancy_date = ymd(occupancy_date)) |> 
  select(occupancy_date, occupied_beds)

head(toronto_shelters_clean)
  • p. 38: “At this point we can make a nice graph of the number of ridings won by each party in the 2019 Canadian Federal Election.” should refer to the 2021 election.
  • p. 41: Remove a stray “:::”.
  • p. 66: “New Project$dots” should be “New Project…”.
  • p. 138: scale_color_brewer(palette = "Set1") is unnecessary and should be removed.
  • p. 138: The figure caption should refer to inflation not unemployment.
  • p. 154: Q9 is missing a “work” after the code chunk and before the “if”.
  • p. 188: “Leonhard Euler” should be “Carl Friedrich Gauss”.
  • p. 279: “detonated” should be “denoted”.
  • p. 342: Q5 option b is repeated in option c.
  • p. 347: The “Exploratory data analysis” chapter of R for Data Science is 11, not 12.
  • p. 353: Fix a “the the”.
  • p. 355: “…results in an estimate of 5,814, both of which are too low.” should be “…results in an estimate of 11,197, the former is too low and the latter is too high.”
  • p. 371: The sentence that references Figure 11.11a was confusing and needs to more clearly reference the figure.
  • p. 587: The link should be: https://fivethirtyeight.com/features/police-misconduct-costs-cities-millions-every-year-but-thats-where-the-accountability-ends/