22.3 Grabbing data

  • As a case study, grab the item checkouts dataset from Seattle libraries here: data.seattle.gov/Community/Checkouts-by-Title/tmmm-ytt6
  • DONT DOWNLOAD DATA BY HAND!!! (it has 41,389,465 rows of data)
  • You can download it instead with the code here (which can handle giant data sets and gives progress bar in console for download status):
dir.create("data", showWarnings = FALSE)

curl::multi_download(
  "https://r4ds.s3.us-west-2.amazonaws.com/seattle-library-checkouts.csv",
  "data/seattle-library-checkouts.csv",
  resume = TRUE
)
#> # A tibble: 1 × 10
#>   success status_code resumefrom url                    destfile        error
#>   <lgl>         <int>      <dbl> <chr>                  <chr>           <chr>
#> 1 TRUE            200          0 https://r4ds.s3.us-we… data/seattle-l… <NA> 
#> # ℹ 4 more variables: type <chr>, modified <dttm>, time <dbl>,
#> #   headers <list>