Skip to content

Instantly share code, notes, and snippets.

@dmhowcroft
Last active August 5, 2020 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmhowcroft/207001534da8363053110af39f7664fc to your computer and use it in GitHub Desktop.
Save dmhowcroft/207001534da8363053110af39f7664fc to your computer and use it in GitHub Desktop.
# This is based on https://github.com/publichealthengland/coronavirus-dashboard-api-python-sdk/issues/3
library("reticulate")
pybuiltins <- import_builtins()
cov19 <- import("uk_covid19")
api <- cov19$Cov19API(filters=list('areaType=ltla'),
structure = list("areaType"= "areaType",
"areaName"= "areaName",
"areaCode"= "areaCode",
"specimenDate"= "date",
"dailyLabConfirmedCases"= "newCasesBySpecimenDate",
"totalLabConfirmedCases"= "cumCasesBySpecimenDate"))
csv_from_api <- api$get_csv()
data <- read.csv(text=csv_from_api)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment