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

covid19nytimes

Lifecycle: maturing CRAN status Travis build status

The covid19nytimes package harvests the data made freely available by the New York Times. See https://www.nytimes.com/article/coronavirus-county-data-us.html for more.

Installation

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

``` {r install, eval=FALSE} install.packages("covid19nytimes")

Or the latest development version from [github](https://github.com/covid19R/covid19nytimes)

```r
devtools::install_github("covid19R/covid19nytimes")

Data

The package has the data from states and counties. The package comes with static data that was downloaded at the time of the last package update.

library(covid19nytimes)

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

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

Getting the Most Up to Date Data

To get the most updated data, run the following functions

covid19nytimes_states <- refresh_covid19nytimes_states()

covid19nytimes_counties <- refresh_covid19nytimes_counties()

Columns

The data follows the covid19R standard for tidy Covid-19 data. The data columns are as follows:

Sample visualization

library(dplyr)
library(ggplot2)

covid19nytimes_states %>%
  filter(location %in% c("Washington", "New York", "Massachusetts", "Michigan", "Illinois")) %>%
  filter(data_type == "deaths_total") %>%
  ggplot(aes(x = date, y = value, color = location)) +
  geom_line() +
  theme_minimal(base_size=14) +
  scale_y_continuous()


Covid19R/covid19nytimes documentation built on July 6, 2020, 8:56 p.m.