22.13 dplyr and arrow (2)

  • Let’s use the dplyr pipeline
  • Ex: Counting how many books checked out per month in last five years
query <- seattle_pq |> 
  filter(CheckoutYear >= 2018, MaterialType == "BOOK") |>
  group_by(CheckoutYear, CheckoutMonth) |>
  summarize(TotalCheckouts = sum(Checkouts)) |>
  arrange(CheckoutYear, CheckoutMonth)