View source: R/get_covid_county_demographics.R
| get_county_covid_demographics | R Documentation | 
Retrieve Latest Demographic data from NC DHHS.
get_county_covid_demographics(
  demographic = "age_group",
  region = NULL,
  add_population = TRUE
)
demographic | 
 a string, one of age, k_12, ethnicity, gender, or race  | 
region | 
 a string vector, could a string or vector of the counties of interest  | 
add_population | 
 a boolean, TRUE to add the population estimates (may not be available for all demographics)  | 
library(ggplot2)
library(data.table)
out <- get_county_covid_demographics(region = "Guilford", demographic = "age")
out[,per_capita:=cases/(population/100000)]
ggplot(out, aes(week_of, per_capita, colour = metric))+
geom_line()+
theme_bw()+
theme(legend.position = "top")+
labs(
title = "SARS-CoV-2 Cases per 100k Residents",
subtitle = "Guilford County, North Carolina",
x = "Cases per 100k",
y = NULL
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.