https://github.com/hrbrmstr/cdccovidview
😷Weekly Surveillance Summary of U.S. COVID-19 Activity
https://github.com/hrbrmstr/cdccovidview
cdc-covid-vew covid-19 r rstats
Last synced: 3 months ago
JSON representation
😷Weekly Surveillance Summary of U.S. COVID-19 Activity
- Host: GitHub
- URL: https://github.com/hrbrmstr/cdccovidview
- Owner: hrbrmstr
- License: other
- Created: 2020-04-11T11:04:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T20:58:50.000Z (almost 5 years ago)
- Last Synced: 2025-02-01T21:04:15.847Z (3 months ago)
- Topics: cdc-covid-vew, covid-19, r, rstats
- Language: R
- Homepage:
- Size: 90.8 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
``````{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
``````{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```## What's Inside The Tin
The following functions are implemented:
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```## Installation
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```## Usage
```{r lib-ex}
library(cdccovidview)# current version
packageVersion("cdccovidview")```
```{r ex-01, fig.width = 10, fig.height = 7, cache=TRUE}
library(cdccovidview)
library(hrbrthemes)
library(tidyverse)hosp <- laboratory_confirmed_hospitalizations()
hosp
c(
"0-4 yr", "5-17 yr", "18-49 yr", "50-64 yr", "65+ yr", "65-74 yr", "75-84 yr", "85+"
) -> age_fmutate(hosp, start = mmwr_week_to_date(mmwr_year, mmwr_week)) %>%
filter(!is.na(weekly_rate)) %>%
filter(catchment == "Entire Network") %>%
select(start, network, age_category, weekly_rate) %>%
filter(age_category != "Overall") %>%
mutate(age_category = factor(age_category, levels = age_f)) %>%
ggplot() +
geom_line(
aes(start, weekly_rate)
) +
scale_x_date(
date_breaks = "2 weeks", date_labels = "%b\n%d"
) +
facet_grid(network~age_category) +
labs(
x = NULL, y = "Rates per 100,000 pop",
title = "COVID-NET Weekly Rates by Network and Age Group",
caption = sprintf("Source: COVID-NET: COVID-19-Associated Hospitalization Surveillance Network, Centers for Disease Control and Prevention.\n; Accessed on %s", Sys.Date())
) +
theme_ipsum_es(grid="XY")```
### Clinical Labs
```{r ex-02}
head(clinical_labs())
```### Public Health Labs
```{r ex-03}
head(public_health_labs_national())head(public_health_labs_regional())
```### Emergency Department Visits
```{r ex-04}
head(nssp_er_visits_national())head(nssp_er_visits_regional())
```### Mortality
```{r ex-05}
head(mortality_surveillance_data())
``````{r ex-06}
pd <- provisional_death_counts()head(pd$by_week)
head(pd$by_age)
head(pd$by_state)
head(pd$by_sex)
```## cdccovidview Metrics
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```## Code of Conduct
Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.