All Projects → publichealthengland → coronavirus-dashboard-api-R-sdk

publichealthengland / coronavirus-dashboard-api-R-sdk

Licence: Unknown, MIT licenses found Licenses found Unknown LICENSE MIT LICENSE.md
Coronavirus (COVID-19) in the UK - API Service SDK for R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to coronavirus-dashboard-api-R-sdk

coviddata
Daily COVID-19 statistics by country, region, and city
Stars: ✭ 49 (+113.04%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19-timeseries
Covid19 timeseries data store
Stars: ✭ 38 (+65.22%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19africa
Africa open COVID-19 data working group
Stars: ✭ 47 (+104.35%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19-cli
A CLI for getting covid-19 coronavirus status of your district or state or country at lightning speed right on your terminal built using https://api.covid19india.org.
Stars: ✭ 19 (-17.39%)
Mutual labels:  coronavirus, covid19, covid19-data
COVID-19-AI
Collection of AI resources to fight against Coronavirus (COVID-19)
Stars: ✭ 25 (+8.7%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19-pr-api
COVID-19 Open API for Datasets in Puerto Rico
Stars: ✭ 21 (-8.7%)
Mutual labels:  coronavirus, covid19, covid19-data
COVID-19-DETECTION
Detect Covid-19 with Chest X-Ray Data
Stars: ✭ 43 (+86.96%)
Mutual labels:  coronavirus, covid19, covid19-data
covid-19
An app made with Flutter to track COVID-19 case counts.
Stars: ✭ 47 (+104.35%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19gr
Open Data Aggregation & Knowledge Base Repository for the evolution of the SARS-COV-2 pandemic in Greece.
Stars: ✭ 21 (-8.7%)
Mutual labels:  coronavirus, covid19, covid19-data
COVID19Py
A tiny Python package for easy access to up-to-date Coronavirus (COVID-19, SARS-CoV-2) cases data.
Stars: ✭ 86 (+273.91%)
Mutual labels:  coronavirus, covid19, covid19-data
coronavirus-data
This repository contains data on Coronavirus Disease 2019 (COVID-19) in New York City (NYC), from the NYC Department of Health and Mental Hygiene.
Stars: ✭ 926 (+3926.09%)
Mutual labels:  coronavirus, covid19, covid19-data
COVID19
A web app to display the live graphical state-wise reported corona cases in India so far. It also shows the latest news for COVID-19. Stay Home, Stay Safe!
Stars: ✭ 122 (+430.43%)
Mutual labels:  coronavirus, covid19, covid19-data
covid-19-image-repository
Anonymized dataset of COVID-19 cases with a focus on radiological imaging. This includes images (x-ray / ct) with extensive metadata, such as admission-, ICU-, laboratory-, and patient master-data.
Stars: ✭ 42 (+82.61%)
Mutual labels:  coronavirus, covid19, covid19-data
coronainfobd
Real-time corona-virus tracker of Bangladesh 🇧🇩 which includes latest updates, data visualization, public awareness from WHO and some advice to aware people. 🥰❤
Stars: ✭ 46 (+100%)
Mutual labels:  coronavirus, covid19, covid19-data
ctt
Corona Tracker Tracker Dashboard for the German Corona-Tracing-app
Stars: ✭ 15 (-34.78%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19-kerala-api-deprecated
Deprecated - A fast API service for retrieving day to day stats about Coronavirus(COVID-19, SARS-CoV-2) outbreak in Kerala(India).
Stars: ✭ 14 (-39.13%)
Mutual labels:  coronavirus, covid19, covid19-data
covid19-visualized
COVID-19 World update with data Visualization (Include Indonesia cases)
Stars: ✭ 23 (+0%)
Mutual labels:  coronavirus, covid19, covid19-data
COVID-19-Datasets
Novel Coronavirus (COVID-19) Cases for India, provided by University of Kalyani.
Stars: ✭ 19 (-17.39%)
Mutual labels:  coronavirus, covid19, covid19-data
CoronaCord
Discord bot that displays the latest coronavirus statistics. Currently serving over 5,000 communities on Discord.
Stars: ✭ 23 (+0%)
Mutual labels:  coronavirus, covid19, covid19-data
Coronavirus Tracker Api
🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
Stars: ✭ 1,577 (+6756.52%)
Mutual labels:  coronavirus, covid19

Coronavirus (COVID-19) in the UK - API Service

Software Development Kit (SDK) for R

This is an R SDK for the COVID-19 API, as published by Public Health England on Coronavirus (COVID-19) in the UK. The source code of this library is housed on GitHub.

The API supplies the latest data for the COVID-19 outbreak in the United Kingdom.

The endpoint for the data provided using this SDK is:

https://api.coronavirus.data.gov.uk/v1/data

The SDK is also available for Python and JavaScript.

Installation

You can install the released version of ukcovid19 from CRAN with:

install.packages("ukcovid19")

or install from GitHub as follows:

remotes::install_github("publichealthengland/coronavirus-dashboard-api-R-sdk")

Pagination

Using this SDK will bypass the pagination process. You will always download the entire dataset unless the latest_by argument is defined.

To use the library, run:

library(ukcovid19)

or simply prepend the function names with ukcovid19; for instance:

ukcovid19::get_options()

Examples

We would like to extract the number of new cases, cumulative cases, new deaths and cumulative deaths for England using the API.

We start off by constructing the value of the filters parameter:

query_filters <- c(
    'areaType=nation',
    'areaName=England'
)

Next step is to construct the value of the structure parameter. To do so, we need to find out the name of the metric in which we are interested. You can find this information in the Developer's Guide on the Coronavirus Dashboard website.

In the case of this example, the metrics are as follows:

  • newCasesByPublishDate: New cases (by publish date)
  • cumCasesByPublishDate: Cumulative cases (by publish date)
  • newDeathsByDeathDate: New deaths (by death date)
  • cumDeathsByDeathDate: Cumulative deaths (by death date)

In its simplest form, we construct the structure as follows:

cases_and_deaths = list(
    date = "date",
    areaName = "areaName",
    areaCode = "areaCode",
    newCasesByPublishDate = "newCasesByPublishDate",
    cumCasesByPublishDate = "cumCasesByPublishDate",
    newDeaths28DaysByPublishDate = "newDeaths28DaysByPublishDate",
    cumDeaths28DaysByPublishDate = "cumDeaths28DaysByPublishDate"
)

Now, we can use filters and structure to get the data from the API:

data <- get_data(
    filters = query_filters, 
    structure = cases_and_deaths
)

# Showing the head:
print(head(data))
        date areaName  areaCode newCasesByPublishDate cumCasesByPublishDate newDeaths28DaysByPublishDate cumDeaths28DaysByPublishDate
1 2020-08-19  England E92000001                   707                277516                           15                        36757
2 2020-08-18  England E92000001                   975                276809                           11                        36742
3 2020-08-17  England E92000001                   634                275834                            3                        36731
4 2020-08-16  England E92000001                   952                275200                            3                        36728
5 2020-08-15  England E92000001                   934                274248                            2                        36725
6 2020-08-14  England E92000001                  1284                273314                           10                        36723

To see the timestamp for the last update, run:

timestamp <- last_update(
    filters = query_filters, 
    structure = cases_and_deaths
)

print(timestamp)
[1] "2020-08-02 14:50:59 GMT"

To get the latest data by a specific metric, use the latest_by argument as follows:

all_nations = c(
    "areaType=nation"
)

data <- get_data(
    filters = all_nations, 
    structure = cases_and_deaths,
    latest_by = "newCasesByPublishDate"
)

print(data)
        date areaName  areaCode newCasesByPublishDate cumCasesByPublishDate  newDeathsByDeathDate cumDeathsByDeathDate
1 2020-08-02  England E92000001                   676                262746                    NA                   NA
2 2020-08-02 Scotland S92000003                    31                 18676                    NA                   NA
3 2020-08-02    Wales W92000004                    37                 17315                    NA                   NA

Developed and maintained by Public Health England.

Copyright (c) 2020, Public Health England.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].