tt_load_gh: Load TidyTuesday data from Github

Description Usage Arguments Value PAT Examples

View source: R/tt_load_gh.R

Description

Pulls the readme and URLs of the data from the TidyTuesday github folder based on the date provided

Usage

1
tt_load_gh(x, week, auth = github_pat())

Arguments

x

string representation of the date of data to pull, in YYYY-MM-dd format, or just numeric entry for year

week

left empty unless x is a numeric year entry, in which case the week of interest should be entered

auth

github Personal Access Token. See PAT section for more information

Value

a 'tt' object. This contains the files available for the week, readme html, and the date of the TidyTuesday.

PAT

A Github PAT is a personal Access Token. This allows for signed queries to the github api, and increases the limit on the number of requests allowed from 60 to 5000. Follow instructions from <https://happygitwithr.com/github-pat.html> to set the PAT.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# check to make sure there are requests still available
if(rate_limit_check(quiet = TRUE) > 10 & interactive()){
 tt_gh <- tt_load_gh("2019-01-15")

 ## readme attempts to open the readme for the weekly dataset
 readme(tt_gh)

 agencies <- tt_download(
    tt_gh,
    files = "agencies.csv"
 )


}

tidytuesdayR documentation built on Feb. 1, 2022, 9:07 a.m.