Skip to content

Instantly share code, notes, and snippets.

@sbfnk
Created June 17, 2021 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbfnk/a5749c6536bb3c0969201dd6c18802f2 to your computer and use it in GitHub Desktop.
Save sbfnk/a5749c6536bb3c0969201dd6c18802f2 to your computer and use it in GitHub Desktop.
get all UTLA-level Rt estimates
library("gh")
library("vroom")
owner <- "epiforecasts"
repo <- "covid-rt-estimates"
path <- "subnational/united-kingdom-local/cases/summary/rt.csv"
rt_commits <-
gh("/repos/{owner}/{repo}/commits?path={path}",
owner = owner,
repo = repo,
path = path,
.limit = Inf)
shas <- vapply(rt_commits, "[[", "", "sha")
rt_estimates <-
lapply(shas,
function(sha)
vroom(
paste("https://raw.githubusercontent.com", owner, repo, sha, path,
sep = "/")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment