class: center, middle ## Ingesting Data with `readr` and API Wrapper Packages <img src="img/hero_wall_pink.png" width="800px"/> ### Kelly McConville .large[Math 241 | Week 5 | Spring 2021] --- ## Announcements/Reminders * Added more office hours, starting this week. * For data license questions, make sure to reach out to Mahria, our Data Librarian. * Lab 2 feedback available on Gradescope. * Lab 3 due on Thursday * Mini-Project 1 due next Thursday (Mar 5th) at 8:30am + Presentations during class. + Add slides [here](https://docs.google.com/presentation/d/1Vn_YwO9hqDhDELJ-TqLiHyoLFZ4vroA-FX1aLem3c9U/edit?usp=sharing). --- ## Goals for Today * Live code: Data Wrangling * Ingesting data + Finish on Thursday --- ## `separate()` * Found in `tidyr` * Separate one column into multiple columns. + `col` = name of column to separate + `into` = character vector with names of new columns + `sep` = character to split on ```r library(tidyverse) CDC_sep <- read_csv("/home/courses/math241s21/Data/CDC2.csv") %>% select(GeoLocation, YearStart, LocationAbbr, DataValue, Question) %>% separate(col = GeoLocation, into = c("lat", "long"), sep = ", ") CDC_sep ``` ``` ## # A tibble: 74,811 x 6 ## lat long YearStart LocationAbbr DataValue Question ## <chr> <chr> <dbl> <chr> <dbl> <chr> ## 1 <NA> <NA> 2016 US 16.9 Binge drinking preval… ## 2 (32.84057… -86.63186… 2016 AL 13 Binge drinking preval… ## 3 (64.84507… -147.7220… 2016 AK 18.2 Binge drinking preval… ## 4 (34.86597… -111.7638… 2016 AZ 15.6 Binge drinking preval… ## 5 (34.74865… -92.27449… 2016 AR 15 Binge drinking preval… ## 6 (37.63864… -120.9999… 2016 CA 16.3 Binge drinking preval… ## 7 (38.84384… -106.1336… 2016 CO 19 Binge drinking preval… ## 8 (41.56266… -72.64984… 2016 CT 16.7 Binge drinking preval… ## 9 (39.00883… -75.57774… 2016 DE 17 Binge drinking preval… ## 10 (38.907192 -77.03687… 2016 DC 25.6 Binge drinking preval… ## # … with 74,801 more rows ``` --- ## `separate()` ```r library(stringr) CDC_sep <- read_csv("/home/courses/math241s21/Data/CDC2.csv") %>% select(GeoLocation, YearStart, LocationAbbr, DataValue, Question) %>% separate(col = GeoLocation, into = c("lat", "long"), sep = ", ") %>% mutate(lat = parse_number(lat), long = parse_number(long)) CDC_sep ``` ``` ## # A tibble: 74,811 x 6 ## lat long YearStart LocationAbbr DataValue Question ## <dbl> <dbl> <dbl> <chr> <dbl> <chr> ## 1 NA NA 2016 US 16.9 Binge drinking prevalence amon… ## 2 32.8 -86.6 2016 AL 13 Binge drinking prevalence amon… ## 3 64.8 -148. 2016 AK 18.2 Binge drinking prevalence amon… ## 4 34.9 -112. 2016 AZ 15.6 Binge drinking prevalence amon… ## 5 34.7 -92.3 2016 AR 15 Binge drinking prevalence amon… ## 6 37.6 -121. 2016 CA 16.3 Binge drinking prevalence amon… ## 7 38.8 -106. 2016 CO 19 Binge drinking prevalence amon… ## 8 41.6 -72.6 2016 CT 16.7 Binge drinking prevalence amon… ## 9 39.0 -75.6 2016 DE 17 Binge drinking prevalence amon… ## 10 38.9 -77.0 2016 DC 25.6 Binge drinking prevalence amon… ## # … with 74,801 more rows ``` --- ## Another Example: Live Coding * Also a chance to see some additional `dplyr` functions ```r library(readxl) url <- "https://www.bts.gov/sites/bts.dot.gov/files/table_01_33_102020.xlsx" destfile <- "table_01_33_102020.xlsx" curl::curl_download(url, destfile) Amtrak <- read_excel(destfile) Amtrak ``` ``` ## # A tibble: 20 x 35 ## `Table 1-33: Ag… ...2 ...3 ...4 ...5 ...6 ...7 ...8 ...9 ...10 ## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 <NA> 1972 1975 1980 1985 1990 1991 1992 1993 1994 ## 2 Locomotives <NA> NA NA NA NA NA NA NA NA ## 3 Percent availabl… U 87 83 93 84 86 83 84 85 ## 4 Average age (yea… 22.3 14.4 7.4 7 12 13 13 13.2 13.4 ## 5 Passenger and ot… <NA> NA NA NA NA NA NA NA NA ## 6 Percent availabl… U 82 77 90 90 92 90 89 88 ## 7 Average age (yea… 22 24.7 14.3 14.2 20 21 21.5 22.6 22.4 ## 8 KEY: U = data a… <NA> NA NA NA NA NA NA NA NA ## 9 <NA> <NA> NA NA NA NA NA NA NA NA ## 10 a Year-end daily… <NA> NA NA NA NA NA NA NA NA ## 11 b Fiscal Year-en… <NA> NA NA NA NA NA NA NA NA ## 12 <NA> <NA> NA NA NA NA NA NA NA NA ## 13 NOTES <NA> NA NA NA NA NA NA NA NA ## 14 1972 was Amtrak'… <NA> NA NA NA NA NA NA NA NA ## 15 Roadrailers are … <NA> NA NA NA NA NA NA NA NA ## 16 <NA> <NA> NA NA NA NA NA NA NA NA ## 17 SOURCES <NA> NA NA NA NA NA NA NA NA ## 18 1972-80: Amtrak,… <NA> NA NA NA NA NA NA NA NA ## 19 1985-2000: Ibid.… <NA> NA NA NA NA NA NA NA NA ## 20 2001-19: Amtrak,… <NA> NA NA NA NA NA NA NA NA ## # … with 25 more variables: ...11 <dbl>, ...12 <dbl>, ...13 <dbl>, ...14 <dbl>, ## # ...15 <dbl>, ...16 <dbl>, ...17 <chr>, ...18 <chr>, ...19 <dbl>, ## # ...20 <dbl>, ...21 <dbl>, ...22 <dbl>, ...23 <dbl>, ...24 <dbl>, ## # ...25 <dbl>, ...26 <dbl>, ...27 <dbl>, ...28 <dbl>, ...29 <dbl>, ## # ...30 <dbl>, ...31 <dbl>, ...32 <chr>, ...33 <chr>, ...34 <chr>, ## # ...35 <chr> ``` --- ## Data Ingestation Start easy: Flat files ```r CDC <- readr::read_csv("/home/courses/math241s21/Data/CDC2.csv") ``` * Lots of useful arguments in `read_csv()` + `skip` + `col_names` and `col_types` + `na` * Other packages for different file formats + `haven`: SPSS, Stata, and SAS files + `readxl`: Excel files * For large files consider `fread()` in `data.table` --- ## If `fread()` from `data.table` is faster, why not always use `fread()`? -- * If using `tidyverse` packages, it is often easiest to stay within the family because... + Functions play nicely together. + Easier to read your code. -- * Good to load a minimal amount of packages. + Can also be an argument for using `read.csv()`. -- Check if loading a new package is worth it. --- ## Example: Is `fread()` worth it? * Main differences between base, `readr`, and `data.table`: + All read a flat file into a data frame. + `readr` reads in as a [tibble](https://cran.r-project.org/web/packages/tibble/vignettes/tibble.html). + `data.table` reads in as a [data.table](https://www.rdocumentation.org/packages/data.table/versions/1.10.4/topics/data.table-package). + `readr` and `data.table` don't automatically convert characters to factors. + [Why?](https://simplystatistics.org/2015/07/24/stringsasfactors-an-unauthorized-biography/) + Time: base > readr > data.table --- ## Example: Is `fread()` worth it? ```r system.time(dat1 <- read.csv("https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD")) ``` ``` ## user system elapsed ## 0.696 0.025 4.915 ``` ```r system.time({ library(readr) dat2 <- read_csv("https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD")}) ``` ``` ## user system elapsed ## 0.498 0.004 4.028 ``` ```r system.time({ library(data.table) dat3 <- fread("https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD")}) ``` ``` ## user system elapsed ## 0.33 0.02 8.71 ``` --- ## Example: Is `fread()` worth it? ```r system.time(dat1 <- read.csv("https://ed-public-download.app.cloud.gov/downloads/Most-Recent-Cohorts-All-Data-Elements.csv")) ``` ``` ## user system elapsed ## 12.90 0.19 13.39 ``` ```r system.time({ library(readr) dat2 <- read_csv("https://ed-public-download.app.cloud.gov/downloads/Most-Recent-Cohorts-All-Data-Elements.csv")}) ``` ``` ## user system elapsed ## 12.72 0.35 13.46 ``` ```r system.time({ library(data.table) dat3 <- fread("https://ed-public-download.app.cloud.gov/downloads/Most-Recent-Cohorts-All-Data-Elements.csv")}) ``` ``` ## user system elapsed ## 5.45 0.74 11.82 ``` --- ## But careful: Not all functions play nice with `tidyverse` objects! ```r # Load data library(tidyverse) fmli <- read_csv("/home/courses/math241s21/Data/fmli.csv", na = c("NA", ".")) # Determine its type class(fmli) ``` ``` ## [1] "spec_tbl_df" "tbl_df" "tbl" "data.frame" ``` ```r # Create a regression tree library(rpms) tree <- rpms(rp_equ = FINCBTAX ~ BLS_URBN + IRAX, data = fmli) ``` ``` ## Error in split_rpms(node = 1, y, mX, X, vX, cat_vec, weights = weights, : Not compatible with requested type: [type=list; target=double]. ``` --- ## But careful: Not all functions play nice with `tidyverse` objects! ```r # Load data library(tidyverse) fmli <- read_csv("/home/courses/math241s21/Data/fmli.csv", na = c("NA", ".")) %>% as.data.frame() # Determine its type class(fmli) ``` ``` ## [1] "data.frame" ``` ```r # Create a regression tree library(rpms) tree <- rpms(rp_equ = FINCBTAX ~ BLS_URBN + IRAX, data = fmli) ``` --- ## Why are we so `tidyverse` focused in Math 241 and not just using `base` as much as possible? -- * High-quality, consistent functions especially for graphics and wrangling * Written for humans: Shorter learning curve * Well-documented * Employers may not be able use `ggplot2` or really know what it is used for but they have figured out that it is a good buzzword. --- ### Tidyverse * I have mentioned [Hadley Wickham](http://hadley.nz/) a few times. + Chief Scientist at RStudio + Co-creator of many of the `tidyverse` packages -- * BUT, there are LOTS of people who have worked on the `tidyverse` packages: ```r citation("tidyverse") ``` ``` ## ## Wickham et al., (2019). Welcome to the tidyverse. Journal of Open ## Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686 ## ## A BibTeX entry for LaTeX users is ## ## @Article{, ## title = {Welcome to the {tidyverse}}, ## author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani}, ## year = {2019}, ## journal = {Journal of Open Source Software}, ## volume = {4}, ## number = {43}, ## pages = {1686}, ## doi = {10.21105/joss.01686}, ## } ``` --- ## Grabbing Data From The Web Four main categories (listed from easiest to hardest): * **Download and Go**: Flat files, such as csvs, that you can download and then install via something like `readr` -- * **Package API Wrapper**: R packages that talk to APIs. -- * **API**: Talking to the APIs directly. -- * **Scrap**: Scraping directly from a website. --- ## Download and Go * You are (likely) doing this for your project. * We did this for the R Data Package demo: ```r dat <- readr::read_csv("https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD") ``` --- ## Package API Wrapper Step back: What is an API? -- API = Application Programming Interface -- Web API: Allows access to an organization’s assets (e.g. its data) via a defined set of messages. In R: * (Client) Give R a URL to request information (data) from * (Server) API sends back a response -- * There are over 10,000 APIs on the web. --- ## APIs * Many organizations have made their data available via APIs over the internet. * Other people have written R packages that wrap the API. + R functions that will make the query and format the response for you. + Output is then often a data frame! * Want to explore API wrappers today. (Will talk to APIs directly next class.) * (Often) Need an API key. + So they know who is requesting their data and when to limit the amount of data given. --- ## Example API wrapper: `rebird` * [eBird](https://ebird.org/home) is an online database of bird sightings. * [rebird](https://github.com/ropensci/rebird) is an R interface to the eBird API ```r devtools::install_github("ropensci/rebird") ``` * Need an API key + Link to your account ```r ebird_key <- "Insert key" ``` --- ## Example API wrapper: `rebird` * Search for bird occurrences by latitude and longitude point ```r library(rebird) species_code("Corvus brachyrhynchos") ``` ``` ## [1] "amecro" ``` --- ```r ebirdgeo(species = "amecro", lat = 45.5, lng = -122.7, key = ebird_key) ``` ``` ## # A tibble: 720 x 13 ## speciesCode comName sciName locId locName obsDt howMany lat lng obsValid ## <chr> <chr> <chr> <chr> <chr> <chr> <int> <dbl> <dbl> <lgl> ## 1 amecro America… Corvus… L186… Columb… 2021… 1 45.6 -123. TRUE ## 2 amecro America… Corvus… L803… 20937 … 2021… 1 45.5 -123. TRUE ## 3 amecro America… Corvus… L866… Rose C… 2021… 38 45.6 -123. TRUE ## 4 amecro America… Corvus… L138… 5734 N… 2021… 10 45.6 -123. TRUE ## 5 amecro America… Corvus… L407… Willam… 2021… 10 45.6 -123. TRUE ## 6 amecro America… Corvus… L871… Wrinn … 2021… 1 45.5 -123. TRUE ## 7 amecro America… Corvus… L141… Whitak… 2021… 7 45.6 -123. TRUE ## 8 amecro America… Corvus… L111… Liberty 2021… 5 45.6 -123. TRUE ## 9 amecro America… Corvus… L561… My Bac… 2021… 1 45.4 -123. TRUE ## 10 amecro America… Corvus… L130… Woodla… 2021… 1 45.6 -123. TRUE ## # … with 710 more rows, and 3 more variables: obsReviewed <lgl>, ## # locationPrivate <lgl>, subId <chr> ``` --- ## Example API wrapper: `rebird` Recent notable sightings <img src="img/rhum.jpg" width="213" /> ```r ebirdnotable(lat = 45.5, lng = -122.7, key = ebird_key) ``` ``` ## # A tibble: 695 x 13 ## speciesCode comName sciName locId locName obsDt howMany lat lng obsValid ## <chr> <chr> <chr> <chr> <chr> <chr> <int> <dbl> <dbl> <lgl> ## 1 goleag Golden … Aquila… L995… Skokom… 2021… 1 47.3 -123. FALSE ## 2 towsol Townsen… Myades… L128… Discov… 2021… 1 47.7 -122. FALSE ## 3 rusbla Rusty B… Euphag… L252… Fall C… 2021… 1 47.6 -122. FALSE ## 4 yehbla Yellow-… Xantho… L252… Fall C… 2021… 1 47.6 -122. FALSE ## 5 turvul Turkey … Cathar… L138… 97 Nor… 2021… 1 46.2 -123. FALSE ## 6 whtkit White-t… Elanus… L387… Puget … 2021… 1 46.2 -123. FALSE ## 7 batpig1 Band-ta… Patagi… L778… Sutton… 2021… 1 44.1 -124. FALSE ## 8 daejun1 Dark-ey… Junco … L268… Charne… 2021… 1 44.0 -123. FALSE ## 9 swahaw Swainso… Buteo … L727… Woodla… 2021… 1 45.9 -123. FALSE ## 10 mdxmal1 Muscovy… Cairin… L321… Lake S… 2021… 1 47.6 -122. TRUE ## # … with 685 more rows, and 3 more variables: obsReviewed <lgl>, ## # locationPrivate <lgl>, subId <chr> ``` --- ## Example API wrapper: `rplos` [PLOS ONE](https://journals.plos.org/plosone/) is an open-access journal published by the Public Library of Science. * [rplos](https://cran.rstudio.com/web/packages/rplos/index.html) interacts with the PLOS API. ```r library(rplos) ``` --- ## Example API wrapper: `rplos` Search PLoS papers ```r searchplos(q = "p-value", fl = "id", limit = 5, fq = 'journal_key:PLoSONE') ``` ``` ## $meta ## # A tibble: 1 x 2 ## numFound start ## <int> <int> ## 1 148099 0 ## ## $data ## # A tibble: 5 x 1 ## id ## <chr> ## 1 10.1371/journal.pone.0046363 ## 2 10.1371/journal.pone.0124107 ## 3 10.1371/journal.pone.0014770 ## 4 10.1371/journal.pone.0001036 ## 5 10.1371/journal.pone.0220189 ``` --- ## Example API wrapper: `rplos` Search PLoS papers ```r searchplos(q = "statistically significant", fl = "id", limit = 5, fq = 'journal_key:PLoSONE') ``` ``` ## $meta ## # A tibble: 1 x 2 ## numFound start ## <int> <int> ## 1 188177 0 ## ## $data ## # A tibble: 5 x 1 ## id ## <chr> ## 1 10.1371/journal.pone.0197440 ## 2 10.1371/journal.pone.0215052 ## 3 10.1371/journal.pone.0124516 ## 4 10.1371/journal.pone.0196258 ## 5 10.1371/journal.pone.0210668 ``` --- ## Example API wrapper: `rplos` ```r full_text_urls(doi= '10.1371/journal.pone.0197440') ``` ``` ## [1] "http://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0197440&type=manuscript" ``` * [There is hope.](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0197440) --- ## Example API wrapper: `rscorecard` * The US Department of Education shares their [College Scorecard data](https://collegescorecard.ed.gov/) via an API. * [`rscorecard`](https://cran.r-project.org/web/packages/rscorecard/) wraps this API. * Note: can also store keys in your R environment (so that you don't have to specify them each time) ```r library(rscorecard) sc_key("insert key") ``` ```r sc_dict('ugds') ``` ``` ## ## --------------------------------------------------------------------- ## varname: ugds source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Enrollment of undergraduate certificate/degree-seeking students ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_white source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are white ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_black source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are black ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_hisp source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are Hispanic ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_asian source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are Asian ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_aian source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are American Indian/Alaska Native ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_nhpi source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are Native Hawaiian/Pacific Islander ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_2mor source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are two or more races ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_nra source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## who are non-resident aliens ## ## VALUES: NA ## ## ## --------------------------------------------------------------------- ## varname: ugds_unkn source: IPEDS ## --------------------------------------------------------------------- ## DESCRIPTION: ## ## Total share of enrollment of undergraduate degree-seeking students ## whose race is unknown ## ## VALUES: NA ## ## --------------------------------------------------------------------- ## Printed information for 10 of out 17 variables. ## Increase limit to see more variables. ``` --- ## Example API wrapper: `rscorecard` * Grab data on schools * Uses the pipe `%>%` and the spirit of `dplyr` * Required: + `sc_unit()`: start the API request + `sc_get()`: stop the API request ```r dat <- sc_init() %>% sc_filter(region == 8, ccbasic %in% c(21, 22, 23), locale == 11) %>% sc_select(instnm, stabbr, ugds, adm_rate) %>% sc_get() %>% arrange(adm_rate) ``` --- ## Example API wrapper: `rscorecard` ```r dat ``` ``` ## # A tibble: 12 x 5 ## instnm stabbr ugds adm_rate year ## <chr> <chr> <int> <dbl> <chr> ## 1 Reed College OR 1456 0.350 late… ## 2 Occidental College CA 1910 0.373 late… ## 3 Cogswell College CA 589 0.579 late… ## 4 Pacific Rim Christian University HI 126 0.7 late… ## 5 Lewis & Clark College OR 2011 0.738 late… ## 6 American Jewish University CA 67 0.96 late… ## 7 Warner Pacific University OR 363 0.974 late… ## 8 Warner Pacific University Professional and Gradu… OR 321 NA late… ## 9 Santa Barbara Business College-Bakersfield CA 272 NA late… ## 10 Remington College-Honolulu Campus HI 131 NA late… ## 11 Platt College-Riverside CA 484 NA late… ## 12 Humphreys University-Stockton and Modesto Campus… CA 315 NA late… ``` --- ## Grab song lyrics from [`genuis`](https://github.com/josiahparry/genius) * Note: We will revisit `genius` later in the semester when we are learning how to handle text data. ```r library(genius) hey_jude <- genius_lyrics(artist = "The Beatles", song = "Hey Jude") hey_jude ``` ``` ## # A tibble: 53 x 3 ## track_title line lyric ## <chr> <int> <chr> ## 1 Hey Jude 1 Hey Jude, don't make it bad ## 2 Hey Jude 2 Take a sad song and make it better ## 3 Hey Jude 3 Remember to let her into your heart ## 4 Hey Jude 4 Then you can start to make it better ## 5 Hey Jude 5 Hey Jude, don't be afraid ## 6 Hey Jude 6 You were made to go out and get her ## 7 Hey Jude 7 The minute you let her under your skin ## 8 Hey Jude 8 Then you begin to make it better ## 9 Hey Jude 9 And anytime you feel the pain, hey Jude, refrain ## 10 Hey Jude 10 Don't carry the world upon your shoulders ## # … with 43 more rows ``` --- ## Data from APIs: What To Do * Ask the internet if there is an R package for a particular API. * If so, read the vignette/help files. * If not, you must talk to the API directly. --- ## Other APIs to Play With! * [spotifyr](https://www.rcharlie.com/spotifyr/) * [ieugwasr](https://mrcieu.github.io/ieugwasr/index.html) * [VancouvR](https://mountainmath.github.io/VancouvR/index.html) * [traveltime](https://tlorusso.github.io/traveltime/vignette.html) * [nbastatR](https://github.com/abresler/nbastatR) * [eia](https://docs.ropensci.org/eia/) * [tradestatistics](https://docs.ropensci.org/tradestatistics/) * [fbicrime](https://github.com/SUN-Wenjun/fbicrime) * [wbstats](https://github.com/nset-ornl/wbstats) * [rtweet](https://docs.ropensci.org/rtweet/)