knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

covid19R

Lifecycle: experimental CRAN status Travis build status

The goal of covid19R is to provide a single package that allows users to access all of the tidy covid-19 datasets collected by data packages that implement the covid19R tidy data standard. It provides access to multiple data sets that meet a tidy data standard.

To learn more abou the Covid19R project, check our extensive documentation about data standards, how to get your data added to this list, and more.

Installation

You can install the development version from github with:

remotes::install_github("covid19r/covid19r")

Getting the Data Information

To see what datasets are available, use get_covid19_data_info()

library(covid19R)

data_info <- get_covid19_data_info()

head(data_info) %>% knitr::kable()

Accessing data

Once you have figured out what dataset you want, you can access it with get_covid19_dataset()

library(dplyr)

nytimes_states <- get_covid19_dataset("covid19nytimes_states")

nytimes_states %>%
  filter(date == max(date)) %>%
  filter(data_type == "cases_total") %>%
  arrange(desc(value)) %>%
  head()

The covid19R Data Standard

While many data sets have their own unique additional columns (e.g., Latitude, Longitude, population, etc.), all datasets have the following columns and are arranged in a long format:

Vocabularies

The location_type, location_code_type, and data_type from datasets and spatial_extent from the data info table all have their own controlled vocabularies. Others might be introduced as the collection of packages matures. To see the possible values of a standardized vocabulary, use get_covid19_controlled_vocab()

get_covid19_controlled_vocab("location_type") %>%
  knitr::kable()


Covid19R/covid19R documentation built on July 26, 2020, 12:38 p.m.