Raw data in searchable form

Data taken from ..

https://data.cdc.gov/NCHS/Conditions-contributing-to-deaths-involving-corona/hk9y-quqm

No analysis yet, but the data tables can be searched.

library(readr)
d <- read_csv("https://data.cdc.gov/api/views/hk9y-quqm/rows.csv?accessType=DOWNLOAD")

gsub(" ", "_", names(d)) -> names(d)
gsub("-", "_", names(d)) -> names(d)
tolower(names(d))->names(d)

library(lubridate)
d$date<-mdy(d$end_week)

d %>% filter(age_group == "All ages") -> all
d %>% filter(age_group != "All ages") -> d
d %>% filter(age_group != "Not stated") -> d

separate(d, `age_group`, into =c("Start", "End")) -> d
d$End<-as.numeric(as.character(d$End))
d$End[is.na(d$End)]<-100


#save(list=ls(), file="cdc_condition.rda")

All ages USA

all %>% filter (state=="US") -> all_usa

DT::datatable(all_usa,  filter = "top", extensions = c('Buttons'), options = list(
                                dom = 'Blfrtip',
                                buttons = c('copy', 'csv', 'excel'), colReorder = TRUE
                              ))

All ages each state

all %>% filter (state!="US") -> all_states

DT::datatable(all_states,  filter = "top", extensions = c('Buttons'), options = list(
                                dom = 'Blfrtip',
                                buttons = c('copy', 'csv', 'excel'), colReorder = TRUE
                              ))

Ages groups USA

d %>% filter (state=="US") -> ages_usa

DT::datatable(ages_usa,  filter = "top", extensions = c('Buttons'), options = list(
                                dom = 'Blfrtip',
                                buttons = c('copy', 'csv', 'excel'), colReorder = TRUE
                              ))

Ages groups each state

d %>% filter (state !="US") -> ages_states

DT::datatable(ages_states,  filter = "top", extensions = c('Buttons'), options = list(
                                dom = 'Blfrtip',
                                buttons = c('copy', 'csv', 'excel'), colReorder = TRUE
                              ))