You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.1 KiB

---
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")
```
4 years ago
```{r ex-01, fig.width = 10, fig.height = 7}
library(cdccovidview)
library(hrbrthemes)
library(tidyverse)
hosp <- laboratory_confirmed_hospitalizations()
c(
"0-4 yr", "5-17 yr", "18-49 yr", "50-64 yr", "65+ yr", "65-74 yr", "75-84 yr", "85+"
) -> age_f
mutate(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<https://gis.cdc.gov/grasp/COVIDNet/COVID19_3.html>; Accessed on %s", Sys.Date())
) +
theme_ipsum_es(grid="XY")
```
## 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.