Skip to content

gshs-ornl/covidmodeldata

Repository files navigation

covidmodeldata

The goal of covidmodeldata is to download and format data

Installation

remotes::install_github("nset-ornl/covidmodeldata")

Download and Format New York Times Data

The fields ending in _mdl are the modeled data. The fields not ending with mdl match the originally reported values. If a state is skiped such as Rhode Island, the _mdl values for that state will match the original values while values for other states will be the modeled values.

library(covidmodeldata)
library(tidyverse)

df <- get_nyt() %>%
  format_nyt(
    skip_assignment = c("44") # don't assign Rhode Island cases
    )

glimpse(df)
#> Observations: 50,671
#> Variables: 13
#> $ geoid            <chr> "01001", "01001", "01001", "01001", "01001", "0100...
#> $ state_fips       <chr> "01", "01", "01", "01", "01", "01", "01", "01", "0...
#> $ state_name       <chr> "Alabama", "Alabama", "Alabama", "Alabama", "Alaba...
#> $ county_name      <chr> "Autauga", "Autauga", "Autauga", "Autauga", "Autau...
#> $ date             <date> 2020-03-24, 2020-03-25, 2020-03-26, 2020-03-27, 2...
#> $ total_cases      <dbl> 1, 4, 6, 6, 6, 6, 7, 7, 10, 10, 12, 12, 12, 12, 12...
#> $ total_deaths     <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,...
#> $ new_cases        <dbl> 0, 3, 2, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 5,...
#> $ new_deaths       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...
#> $ total_cases_mdl  <dbl> 1, 4, 6, 6, 6, 6, 7, 7, 10, 10, 12, 12, 12, 12, 12...
#> $ total_deaths_mdl <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,...
#> $ new_cases_mdl    <dbl> 1, 3, 2, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 5,...
#> $ new_deaths_mdl   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...

ACS data and Geometries

glimpse(acs_data)
#> Observations: 3,138
#> Variables: 21
#> $ geoid                                      <chr> "01001", "01003", "01005...
#> $ state_fips                                 <chr> "01", "01", "01", "01", ...
#> $ state_name                                 <chr> "Alabama", "Alabama", "A...
#> $ county_name                                <chr> "Autauga", "Baldwin", "B...
#> $ county_name_long                           <chr> "Autauga County, Alabama...
#> $ acs_total_pop_e                            <dbl> 54654, 205093, 22882, 20...
#> $ acs_total_pop_m                            <dbl> 161, 459, 275, 202, 117,...
#> $ acs_median_income_e                        <dbl> 29667, 28632, 18138, 222...
#> $ acs_median_income_m                        <dbl> 1608, 904, 1210, 1330, 1...
#> $ acs_median_age_e                           <dbl> 37.8, 42.8, 39.9, 39.9, ...
#> $ acs_median_age_m                           <dbl> 0.4, 0.3, 0.5, 1.1, 0.4,...
#> $ cbsa_code                                  <chr> "33860", "19300", "21640...
#> $ metropolitan_division_code                 <chr> NA, NA, NA, NA, NA, NA, ...
#> $ csa_code                                   <chr> "388", "380", NA, "142",...
#> $ cbsa_title                                 <chr> "Montgomery, AL", "Daphn...
#> $ metropolitan_micropolitan_statistical_area <chr> "Metropolitan Statistica...
#> $ metropolitan_division_title                <chr> NA, NA, NA, NA, NA, NA, ...
#> $ csa_title                                  <chr> "Montgomery-Selma-Alexan...
#> $ fips_state_code                            <chr> "01", "01", "01", "01", ...
#> $ central_outlying_county                    <chr> "Central", "Central", "C...
#> $ geometry                                   <list> [1269841, 1248372, 1240...

Landscan USA Population Data

glimpse(landscan_usa)
#> Observations: 3,138
#> Variables: 7
#> $ geoid          <chr> "01001", "01003", "01005", "01007", "01009", "01011"...
#> $ night_pop      <dbl> 55601, 218022, 24881, 22400, 57840, 10138, 19680, 11...
#> $ night_pop_1m   <dbl> 0.05560, 0.21802, 0.02488, 0.02240, 0.05784, 0.01014...
#> $ night_pop_100k <dbl> 0.5560, 2.1802, 0.2488, 0.2240, 0.5784, 0.1014, 0.19...
#> $ day_pop        <dbl> 41423, 206846, 25987, 18295, 42508, 8857, 18774, 121...
#> $ day_pop_1m     <dbl> 0.04142, 0.20685, 0.02599, 0.01829, 0.04251, 0.00886...
#> $ day_pop_100k   <dbl> 0.4142, 2.0685, 0.2599, 0.1830, 0.4251, 0.0886, 0.18...

About

An R Package for organizing the data used in the county level covid19 model

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages