get_county_covid_demographics: Get Reported Demographics by County

View source: R/get_covid_county_demographics.R

get_county_covid_demographicsR Documentation

Get Reported Demographics by County

Description

Retrieve Latest Demographic data from NC DHHS.

Usage

get_county_covid_demographics(
  demographic = "age_group",
  region = NULL,
  add_population = TRUE
)

Arguments

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)

Examples

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
)


nctriadresearch/nccovid documentation built on April 9, 2023, 7:03 a.m.