View source: R/pull_hospitalization_demos.R
pull_hospitalization_demos | R Documentation |
A Helper Function That Pull Hospitalizations by Demographics as Posted by NCDHHS
pull_hospitalization_demos()
a data.table
o <- pull_hospitalization_demos()
age_only <-o[demographic=="Age"&covid_status=="Confirmed"]
age_only <- age_only[date<Sys.Date()-90]
plot(NULL,
xlim=range(age_only$date),
ylim=range(age_only$value), ylab="Admissions",
xlab="Date", main = "Admissions by Age")
buckets <- unique(age_only$category)
my_cols <- c("#00A2B2", "#F1BD51", "#00205C", "#c9c9c9", "#7750A9", "#B7D866",
"#5C5859", "#DB2B27", "#63CCFF", "#000000", "#123453")
names(my_cols) <- buckets
for(i in buckets){
lines(age_only[category==i]$date,
age_only[category==i]$value,
col = my_cols[[i]])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.