tt_load: Load TidyTuesday data from Github

Description Usage Arguments Value PAT Examples

View source: R/tt_load.R

Description

Load TidyTuesday data from Github

Usage

1
tt_load(x, week, download_files = "All", ..., 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

download_files

which files to download from repo. defaults and assumes "All" for the week.

...

pass methods to the parsing functions. These will be passed to ALL files, so be careful.

auth

github Personal Access Token. See PAT section for more information

Value

tt_data object, which contains data that can be accessed via '$', and the readme for the weeks TidyTuesday through printing the object or calling 'readme()'

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
# check to make sure there are requests still available
if(rate_limit_check(quiet = TRUE) > 10){

tt_output <- tt_load("2019-01-15")
tt_output
agencies <- tt_output$agencies

}

tidytuesdayR documentation built on July 10, 2020, 9:05 a.m.