knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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.
You can install the development version from github with:
remotes::install_github("covid19r/covid19r")
To see what datasets are available, use get_covid19_data_info()
library(covid19R) data_info <- get_covid19_data_info() head(data_info) %>% knitr::kable()
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()
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:
,
, and can be split by tidyr::separate()
, if you wish.fips_code
total_cases
and total_deaths
, cumulative measures of both.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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.