knitr::opts_chunk$set(echo = FALSE,
                      warning = FALSE,
                      message = FALSE,
                      out.width = "100%",
                      collapse = TRUE,
                      comment = "#>"
)

library(indianacovid19data)
library(dplyr)
library(purrr)
library(gt)
library(gtsummary)

Historical Weekly COVID-19 Cases by Age for Indiana

Description

Processed data for Demographics heatmaps that shows a breakdown of weekly COVID-19 cases by age group.

Reference Entry

age_cases_heat

Script

Processing: process-demog-data.R

Raw Sources

Indiana Data Hub: COVID-19 CASE DEMOGRAPHICS
tidycensus R package: website, 2018 age populations for Indiana

Notes

Other variables:
- end_date: Ordered factor; date of the last day of the weekly interval
- daily_cases: Cases for the end_date; vestigial column that was used to calculate weekly_cases
- pop: 2018 age populations for Indiana that's used to calculate prop_cases
\

ach_var_defs <- c("Age group",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "Weekly count of COVID-19 confirmed cases by age group",
                  "Number of cases scaled to per 1000 residents per age group")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(age_cases_heat,
            missing = "ifany",
            missing_text = "Missing",
            include = c(age_grp, weekly_cases, prop_cases)) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = ach_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Weekly COVID-19 Deaths by Age Group for Indiana

Description

Processed data for Demographics line charts that shows counts and trends of weekly COVID-19 deaths by age group.

Reference Entry

age_death_line

Script

Processing: process-demog-data.R

Raw Sources

Indiana Data Hub: COVID-19 CASE DEMOGRAPHICS

Notes

Other variables: - date_text: date label for the chart
- tooltip: pop-up text for points in chart with death counts and date
\

adl_var_defs <- c("Date of the last day of the weekly interval",
                  "Age group",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "Weekly count of COVID-19 confirmed deaths by age group")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(age_death_line,
            missing = "ifany",
            missing_text = "Missing",
            include = c(end_date, agegrp, weekly_total)) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = adl_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Daily COVID-19 Hospital Admissions by Age Group for Indiana

Description

Raw data for the Hospitals line charts that shows daily COVID-19 hospital admissions by age group and gender.

Reference Entry

age_hosp_line

Script

Collection: scrape-regenstrief-tableau.R

Raw Sources

Regenstrief Institute: dashboard

Notes

This dataset is incomplete with random gaps between days.

\

ahl_var_defs <- c("Date (Daily)",
                  "Age group",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "Daily COVID-19 male hospital admissions by age group",
                  "Daily COVID-19 female hospital admissions by age group",
                  "Daily COVID-19 total hospital admissions by age group")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(age_hosp_line,
            missing = "ifany",
            missing_text = "Missing",
            include = everything()) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = ahl_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Daily ICU Beds and Ventilators for Indiana

Description

Raw data for the Static Charts Hospitalizations, ICU Beds and Ventilator Availability that shows resource counts of ICU beds and ventilators.

Reference Entry

beds_vents_complete

Script

Collection: build-datasets.R

Raw Sources

Indiana Data Hub: COVID-19 BEDS AND VENTS

Notes

The source publishs daily excel spreadsheets with total resource counts, and these spreadsheets are collected and joined daily to produce a dataset with historical values.

\

bvc_var_defs <- c("Date (Daily)",
                  "Total ICU beds",
                  "Total ICU beds occupied with COVID-19 patients",
                  "Total ICU beds occupied with non-COVID-19 patients",
                  "Total available ICU beds",
                  "Total ventilators",
                  "Total ventilators being used by COVID-19 patients",
                  "Total ventilators being used by non-COVID-19 patients",
                  "Total available ventilators")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(beds_vents_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = everything()) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = bvc_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ "150px") %>% 
  as_raw_html()

\ \ \

Historical Google Maps Mobility Indices for Indiana

Description

Processed data for the Google Maps Mobility Indices line chart that shows percent differences from a mobility baseline that was calculated during the 5-week period Jan 3 – Feb 6, 2020. These percent changes show how lengths-of-stay at different locations have changed from pre-pandemic conditions.

Reference Entry

goog_mob_ind

Script

Miscellaneous: goog-mob-line.R

Raw Sources

Google Mobility Reports: website

Notes

\

goog_var_defs <- c("Date (Daily)",
                   "Length-of-stay (mobility) measurements are calculated for these location categories",
                   "",
                   "",
                   "",
                   "Percent difference from the mobility baseline for each category",
                   "TRUE/FALSE binary for whether the date is on a weekend or not")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(goog_mob_ind,
            missing = "ifany",
            missing_text = "Missing",
            include = everything()) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = goog_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(150)) %>% 
  as_raw_html()

\ \ \

Historical State Hospital Staff Shortages, Hospital Mortality Rate, Hospital Admissions and Ages Skewness of Admissions for Indiana

Description

Processed data for Hospitals line charts that shows state hospital staff shortages, hospital mortality rate, hospital admissions, and age skewness of hospital admissions towards older patients.

Reference Entry

hosp_msas_line

Script

Process: process-hospitals-data.R

Raw Sources

Regenstrief Institute: dashboard
Department of Health and Human Services: COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries
Department of Health and Human Services: COVID-19 Reported Patient Impact and Hospital Capacity by Facility

Notes

Other variables:
- date: Ordered factor, Month Day format
\

msas_var_defs <- c("Percent of reporting hospitals that have reported staffing shortages for that day. That percentage is averaged over a rolling, seven day window",
                   "Ratio of deaths of hospitalized COVID-19 patients and unique COVID-19 hospital admissions. Each rate is calculated over a rolling, 14-day window",
                   "Daily total of unique individuals that have tested positive for COVID-19 and been admitted to a hospital on the that day. Those daily counts are averaged over a rolling, seven day window",
                   "Measurement of the age makeup of the COVID-19 hospital admissions data. It's calculated over a rolling, 14 day window")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(hosp_msas_line,
            missing = "ifany",
            missing_text = "Missing",
            include = -date) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = msas_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(150)) %>% 
  as_raw_html()

\ \ \

Local Hospital Capacity for Indiana

Description

Processed data for the Hospitals Local Hospital Capacity table that shows capacity measures and counts of COVID-19 patients for hospitals at the local level.

Reference Entry

hosp_react_tab

Script

Process: process-hospitals-data.R

Raw Sources

Department of Health and Human Services: COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries

Notes

Other variables: - hospital_name: char, Name of hospital
- address: char, Street address of hospital
- city_zip: char, City and zip code
- county_name: char, Name of county
- avgCovIcuTenKList: nested list, end_date and average daily number of ICU beds being used by confirmed and suspected COVID-19 patients over the weekly interval
- avgCovHospTenKList: nested list, end_date and average daily number of hospital beds being used by confirmed and suspected COVID-19 patients over the weekly interval
- avgTotImpBedsList: end_date and avgTotImpBeds, the average daily number of staffed total beds available over the weekly interval
\

num_end_dates <- hosp_react_tab %>% 
  distinct(end_date) %>% 
  summarize(num_dates = n()) %>% 
  pull(num_dates)

hrt_var_defs <- purrr::reduce(list(
  "Last day the data was updated for a particular hospital",
  rep("", num_end_dates), 
  "Proportion of the seven-day average of occupied ICU beds to the seven-day average of available ICU beds.",
  "",
  "Proportion of the seven-day average of occupied hospital beds to the seven-day average of available hospital beds.",
  ""
), append)

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(hosp_react_tab,
            missing = "ifany",
            missing_text = "Missing",
            include = c(end_date, sev_day_icu_perc_occup, sev_day_hosp_perc_occup)) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = hrt_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(150)) %>% 
  as_raw_html()

\ \ \

Historical Daily Tests, Cases and Deaths by Age for Indiana

Description

Raw data for Demographics line charts that shows daily case and death counts by age group.

Reference Entry

ind_age_complete

Script

Collection: build-datasets.R

Raw Sources

Indiana Data Hub: COVID-19 CASE DEMOGRAPHICS

Notes

The source publishs daily excel spreadsheets with total resource counts, and these spreadsheets are collected and joined daily to produce a dataset with historical values.
Other variables:
- date: date, yyyy-mm-dd format
\

iac_var_defs <- c("Date (Daily)", 
                  "Age Group",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "",
                  "Number of cases by age group",
                  "Number of deaths by age group",
                  "Number of tests by age group",
                  "Percent of daily cases",
                  "Percent of daily deaths",
                  "Percent of daily tests")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(ind_age_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = everything()) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = iac_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(190)) %>% 
  as_raw_html()

\ \ \

Historical Daily Cases and Deaths by Race for Indiana

Description

Raw data that shows daily case and death counts by race.

Reference Entry

ind_race_complete

Script

Collection: build-datasets.R

Raw Sources

The Covid Tracking Project: The COVID Racial Data Tracker

Notes

The source publishs data every 3 or 4 days.

\

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(ind_race_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, everything())) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0)) %>%
  as_raw_html()

\ \ \

Historical Weekly Median Age of Cases, Weekly Tests and Deaths for Indiana

Description

Processed data for the Demographics bubble chart that shows the number of tests, number of deaths, and median age of the cases per week.

Reference Entry

median_age_bubble

Script

Processing: process-demog-data.R

Raw Sources

Indiana Data Hub: COVID-19 CASE DATA

Notes

Other variables:
- end_date: ordered factor, Month Day format; end date of weekly interval
\

mab_var_defs <- c("Median age of cases for that week",
                  "Number of tests for that week",
                  "Number of deaths for that week")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(median_age_bubble,
            missing = "ifany",
            missing_text = "Missing",
            include = -end_date) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = mab_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(200)) %>% 
  as_raw_html()

\ \ \

Historical Daily Hospital Admissions and Deaths for Indiana

Description

Raw data for the Hospitals line charts that shows daily COVID-19 hospital admissions, hospital deaths, and hospital death rate.

Reference Entry

mort_hosp_line

Script

Collection: scrape-regenstrief-tableau.R

Raw Sources

Regenstrief Institute: dashboard

Notes

This dataset is incomplete with random gaps between days.

\

mhl_var_defs <- c("Date (Daily)",
                  "Number of individuals hospitalized for COVID-19 who died while in the hospital",
                  "Number of unique individuals who have been hospitalized and tested positive for COVID-19",
                  "Percent of individuals hospitalized for COVID-19 who died while in the hospital")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(mort_hosp_line,
            missing = "ifany",
            missing_text = "Missing",
            include = everything()) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = mhl_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ "180px") %>% 
  as_raw_html()

\ \ \

Historical Weekly Positivity Rates and Daily Cases per 100,000 Indiana Residents

Description

Processed data for the Indiana COVIDcast Dashboard that shows weekly positivity rate and daily cases per 100,000 residents per metropolitan statistical area.

Reference Entry

msa_cases100_posrate_historic

Scripts

Processing: process-hist-regional-dat.R

Raw Sources

covidcast R package: website
Michigan Disease Surveillance System: website
Wisconsin Department of Health Services: website
Illinois Department of Public Health: website
Indiana Data Hub: website

Notes

The missing values for pos_rate are partly because this dataset has a row for every day and the positivity rate is calculated every week. The other missing values are for Cincinnati, Louisville, and Evansville. At the time this dashboard was created, those states with counties included in those areas didn't publicly release the necessary data to calcuate their positivity rates.

Other variables:
- geo_value: FIPS codes for msa
- start_date: Start date of the weekly interval for pos_rate
- data_date: Date when data was last updated \

msa_hist_var_defs <- purrr::reduce(list("date for daily cases_100k",
                                        "Metropolitan Statistical Area",
                                        rep("", 15),
                                        "Daily cases per 100,000 residents per MSA",
                                        "Weekly positivity rate per MSA",
                                        ""), append)

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(msa_cases100_posrate_historic,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, msa, cases_100k, pos_rate)) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = msa_hist_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Daily Values of Delphi Research Groups Combined Indicator for Indiana

Description

Processed data for the Indiana COVIDcast Dashboard that shows historic daily values of Delphi Research Group's Combined Indicator for each methropolitan statistical area.

Reference Entry

dash_ci_line

Scripts

Processing: process-dashboard-data.R

Raw Sources

covidcast R package: website

Notes

\

dcl_var_defs <- purrr::reduce(list("Date (Daily)",
                                   "Metropolitan Statistical Area",
                                   rep("", 15),
                                   "Delphi Research Group's “Combined” indicator"), append)

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(dash_ci_line,
            missing = "ifany",
            missing_text = "Missing",
            include = c(time_value, name, value)) %>%
  modify_header(update = list(label ~ 'Variable')) %>%
  modify_table_body(dplyr::mutate, defs = dcl_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>%
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Weekly COVID-19 Statistics and Counts for Illinois Counties

Description

Raw data for the Indiana COVIDcast Dashboard that shows various weekly COVID-19 county statistics for Illinois

Reference Entry

illinois_tests_complete

Scripts

Collection: build-regional-dat.R

Raw Sources

Illinois Department of Public Health: website

Notes

These data are published in weekly intervals into a HTML table then scraped and collected.
There are other missing data not shown in the table below. Illinois DPH changes/improves the format of their webpage from time to time, and I haven't been changing my scraping code to match in a timely manner. They do have a data portal which has cases, tests, and deaths for each county, but not a historical dataset with exact fields as below. Here are weekly ranges that are missing:
2021-7-18 to 2021-7-24
2021-7-25 to 2021-7-31
2021-9-12 to 2021-9-18
2021-9-5 to 2021-9-11
2021-9-26 to 2021-10-9
2021-10-10 to 2021-10-16

Other variables:
- week: int; week of the year
- County: char; Illinois county name
- New Cases per 100,000: string; format: "\<int> cases" or "\<int> per 100k" or "\<int> per 100kwarning"
- Test Positivity %: string; format: "\<float>%\r\n New Tests: \<int>"
- (%) CLI ED Visits, Adults: string; format: "\<int>%"
- ICU (%) Available: string; format: "\<float>%" \

ill_var_defs <- c("First day of the weekly interval",
                  "Last day of the weekly interval",
                  "Number of COVID-19 deaths per week per county",
                  "")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(illinois_tests_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = c(start_date, end_date, `Number of Deaths`)) %>%
  modify_header(update = list(label ~ 'Variable')) %>%
  modify_table_body(dplyr::mutate, defs = ill_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>%
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Daily COVID-19 Test Results for Indiana Counties

Description

Raw data for the Indiana COVIDcast Dashboard that shows daily COVID-19 county test results for Indiana

Reference Entry

ind_tests_complete

Scripts

Collection: build-regional-dat.R

Raw Sources

Indiana Data Hub: COVID-19 COUNTY-WIDE TEST, CASE, AND DEATH TRENDS

Notes

Other variables:
- county: County name \

ind_var_defs <- c("Date (Daily)",
                  "Number of COVID-19 cases per day per county",
                  "Number of COVID-19 tests per day per county")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(ind_tests_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, positives, num_tests)) %>%
  modify_header(update = list(label ~ 'Variable')) %>%
  modify_table_body(dplyr::mutate, defs = ind_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>%
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

Historical Daily COVID-19 Test Results for Michigan Counties

Description

Raw data for the Indiana COVIDcast Dashboard that shows daily COVID-19 county test results for Michigan

Reference Entry

mich_tests_complete

Scripts

Collection: build-regional-dat.R

Raw Sources

Michigan Department of Health and Human Services: COVID-19 Tests by County

Notes

Other variables:
- county: County name \

mich_var_defs <- c("Date (Daily)",
                   "Number of COVID-19 positive tests per day per county",
                   "Number of COVID-19 negative tests per day per county",
                   "Total number of COVID-19 tests per day per county")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(mich_tests_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, positive, negative, total)) %>%
  modify_header(update = list(label ~ 'Variable')) %>%
  modify_table_body(dplyr::mutate, defs = mich_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>%
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \

OpenTable Year-Over-Year Seated Diners for Regional States

Description

Processed data for the OpenTable Year-Over-Year Seated Diners line charts that shows reservation data from a sample of restaurants across Indiana and other regional states. Each data point is the median daily percent difference in seated diners from 2019 to either 2020 or 2021 depending on the date.

Reference Entry

open_tab_reg

Script

Miscellaneous: opentab-rest-line.R

Raw Sources

OpenTable: State of the Industry

Notes

\

ot_var_defs <- c("Date (Daily)",
                 "State",
                 "",
                 "",
                 "",
                 "",
                 "",
                 "",
                 "Median daily percent difference in seated diners for each state",
                 "TRUE/FALSE binary for whether the date is on a weekend or not")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(open_tab_reg,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, everything())) %>% 
  modify_header(update = list(
    label ~ 'Variable')) %>% 
  modify_table_body(dplyr::mutate, defs = ot_var_defs) %>% 
  modify_header(defs = "Definition") %>% 
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>% 
  cols_align("left", vars(stat_0, defs)) %>%
  cols_width(vars(stat_0) ~ px(150)) %>% 
  as_raw_html()

\ \ \

Historical Daily COVID-19 Test Results for Wisconsin Counties

Description

Raw data for the Indiana COVIDcast Dashboard that shows daily COVID-19 county test results for Wisconsin

Reference Entry

wisc_tests_complete

Scripts

Collection: build-regional-dat.R

Raw Sources

Wisconsin Department of Health Services: COVID-19 Historical Data by County

Notes

Other variables:
- county: County name \

wisc_var_defs <- c("Date (Daily)",
                   "Number of COVID-19 positive tests per day per county",
                  "Number of COVID-19 negative tests per day per county",
                   "")

# table width responsive to length of var_defs text, so may not appear full.width
# use show_header_names to get col names being used by tbl_summary
tbl_summary(wisc_tests_complete,
            missing = "ifany",
            missing_text = "Missing",
            include = c(date, positive, negative)) %>%
  modify_header(update = list(label ~ 'Variable')) %>%
  modify_table_body(dplyr::mutate, defs = wisc_var_defs) %>%
  modify_header(defs = "Definition") %>%
  # show_header_names()
  as_gt() %>%
  tab_options(table.align = "left") %>%
  cols_align("left", vars(stat_0, defs)) %>%
  as_raw_html()

\ \ \



ercbk/indianacovid19data documentation built on Dec. 20, 2021, 5:27 a.m.