@ -1,9 +1,22 @@
[![CRAN\_Status\_Badge ](http://www.r-pkg.org/badges/version/cdcfluview )](https://cran.r-project.org/package=cdcfluview)
[![Travis-CI Build
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-14%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/cdcfluview.svg?branch=master)](https://travis-ci.org/hrbrmstr/cdcfluview)
[![Coverage
Status](https://img.shields.io/codecov/c/github/hrbrmstr/cdcfluview/master.svg)](https://codecov.io/github/hrbrmstr/cdcfluview?branch=master)
Status](https://codecov.io/gh/hrbrmstr/cdcfluview/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/cdcfluview)
[![cran
checks](https://cranchecks.info/badges/worst/cdcfluview)](https://cranchecks.info/pkgs/cdcfluview)
[![CRAN
status](https://www.r-pkg.org/badges/version/cdcfluview)](https://www.r-pkg.org/pkg/cdcfluview)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg)
![License ](https://img.shields.io/badge/License-MIT-blue.svg )
# I M P O R T A N T
@ -109,25 +122,22 @@ library(tidyverse)
# current verison
packageVersion("cdcfluview")
## [1] '0.9.1'
```
## [1] '0.8.0'
### Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories
``` r
glimpse(age_group_distribution(years=2015))
```
## Observations: 1,872
## Variables: 16
## Rows: 1,872
## Columns: 16
## $ sea_label < chr > "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4…
## $ vir_label < fct > A (Subtyping not Performed), A (Subtyping not Performed), A (Subtyping not Performed), A (S…
## $ count < int > 0, 1, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 2, 2, 3, 3, 3, 0, 0, 2, 0, 1, 1, 0, 0…
## $ mmwrid < int > 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…
## $ seasonid < int > 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,…
## $ publishyearweekid < int > 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2 …
## $ publishyearweekid < int > 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3 …
## $ sea_description < chr > "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ sea_startweek < int > 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2…
## $ sea_endweek < int > 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2…
@ -137,6 +147,7 @@ glimpse(age_group_distribution(years=2015))
## $ wk_start < date > 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015-1…
## $ wk_end < date > 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015-1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
```
### Retrieve CDC U.S. Coverage Map
@ -144,46 +155,44 @@ glimpse(age_group_distribution(years=2015))
plot(cdc_basemap("national"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-1.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-1.png" width = "672" / >
``` r
plot(cdc_basemap("hhs"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-2.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-2.png" width = "672" / >
``` r
plot(cdc_basemap("census"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-3.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-3.png" width = "672" / >
``` r
plot(cdc_basemap("states"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-4.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-4.png" width = "672" / >
``` r
plot(cdc_basemap("spread"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-5.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-5.png" width = "672" / >
``` r
plot(cdc_basemap("surv"))
```
< img src = "README_files/figure-gfm/ cdc-basemaps-6.png" width = "672" / >
< img src = "man/figures/README- cdc-basemaps-6.png" width = "672" / >
### State and Territorial Epidemiologists Reports of Geographic Spread of Influenza
``` r
glimpse(geographic_spread())
```
## Observations: 28,151
## Variables: 7
## Rows: 30,427
## Columns: 7
## $ statename < chr > "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Al…
## $ url < chr > "http://adph.org/influenza/", "http://adph.org/influenza/", "http://adph.org/influenza/", "…
## $ website < chr > "Influenza Surveillance", "Influenza Surveillance", "Influenza Surveillance", "Influenza Su…
@ -191,13 +200,12 @@ glimpse(geographic_spread())
## $ weekend < date > 2003-10-04, 2003-10-11, 2003-10-18, 2003-10-25, 2003-11-01, 2003-11-08, 2003-11-15, 2003-1…
## $ season < chr > "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "20…
## $ weeknumber < chr > "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "1", "2…
```
### Laboratory-Confirmed Influenza Hospitalizations
``` r
surveillance_areas()
```
## surveillance_area region
## 1 flusurv Entire Network
## 2 eip California
@ -222,28 +230,24 @@ surveillance_areas()
## 21 ihsp South Dakota
## 22 ihsp Utah
``` r
glimpse(fs_nat < - hospitalizations ( " flusurv " ) )
```
## Observations: 1,746
## Variables: 14
## Rows: 2,979
## Columns: 14
## $ surveillance_area < chr > "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "…
## $ region < chr > "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year < int > 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009 , 2…
## $ season < int > 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49 ,…
## $ wk_start < date > 2009-08-30, 2009-09-06, 2009-09-13, 2009-09-20, 2009-09-27, 2009-10-04, 2009-10-11, 2009 -1…
## $ wk_end < date > 2009-09-05, 2009-09-12, 2009-09-19, 2009-09-26, 2009-10-03, 2009-10-10, 2009-10-17, 2009 -1…
## $ year_wk_num < int > 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7…
## $ rate < dbl > 0.5, 2.5, 4.6, 6.7, 10.9, 18.1, 28.3, 39.1, 47.3, 53.3, 57.5, 60.1, 61.6, 62.9, 64.1, 65.1, …
## $ weeklyrate < dbl > 0.5, 2.0, 2.0, 2.1, 4.3, 7.2, 10.2, 10.8, 8.2, 6.0, 4.2, 2.6, 1.5, 1.3, 1.3, 1.0, 1.2, 1.1, …
## $ age < int > 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 …
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 …
## $ sea_label < chr > "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10 ", "20…
## $ sea_description < chr > "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10 ", "…
## $ mmwrid < int > 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502 , 2…
## $ year < int > 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2018, 2018 , 2…
## $ season < int > 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57 ,…
## $ wk_start < date > 2017-10-01, 2017-10-08, 2017-10-15, 2017-10-22, 2017-10-29, 2017-11-05, 2017-11-12, 2017 -1…
## $ wk_end < date > 2017-10-07, 2017-10-14, 2017-10-21, 2017-10-28, 2017-11-04, 2017-11-11, 2017-11-18, 2017 -1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
## $ rate < dbl > 0.0, 0.1, 0.1, 0.1, 0.3, 0.4, 0.6, 0.8, 1.0, 1.3, 1.8, 2.5, 3.4, 4.2, 5.6, 6.8, 8.2, 10.3, …
## $ weeklyrate < dbl > 0.0, 0.0, 0.0, 0.0, 0.1, 0.1, 0.2, 0.2, 0.2, 0.3, 0.6, 0.6, 0.9, 0.8, 1.3, 1.3, 1.4, 2.1, 1 …
## $ age < int > 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 …
## $ age_label < fct > 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5-17 yr, 5 …
## $ sea_label < chr > "2017-18", "2017-18", "2017-18", "2017-18", "2017-18", "2017-18", "2017-18", "2017-18 ", "20…
## $ sea_description < chr > "Season 2017-18", "Season 2017-18", "Season 2017-18", "Season 2017-18", "Season 2017-18 ", "…
## $ mmwrid < int > 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924 , 2…
``` r
ggplot(fs_nat, aes(wk_end, rate)) +
geom_line(aes(color=age_label, group=age_label)) +
facet_wrap(~sea_description, scales="free_x") +
@ -253,14 +257,13 @@ ggplot(fs_nat, aes(wk_end, rate)) +
theme_ipsum_rc()
```
< img src = "README_files/figure-gfm/ surveillance-areas-1.png" width = "960" / >
< img src = "man/figures/README- surveillance-areas-1.png" width = "960" / >
``` r
glimpse(hospitalizations("eip", years=2015))
```
## Observations: 180
## Variables: 14
glimpse(hospitalizations("eip", years=2015))
## Rows: 270
## Columns: 14
## $ surveillance_area < chr > "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", …
## $ region < chr > "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year < int > 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
@ -268,20 +271,17 @@ glimpse(hospitalizations("eip", years=2015))
## $ wk_start < date > 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015-1…
## $ wk_end < date > 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015-1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
## $ rate < dbl > 0.1, 0.3, 0.4, 0.5, 0.8, 0.8, 1.1, 1.4, 1.6, 1.7, 1.8, 2.1, 2.4, 2.9, 3.2, 3.5, 4.1, 5.3, 6 …
## $ weeklyrate < dbl > 0.1, 0.3, 0.1, 0.1, 0.3, 0.0, 0.3, 0.3, 0.2, 0.1, 0.1, 0.3, 0.3, 0.5, 0.3, 0.3, 0.6, 1.2, 1 …
## $ age < int > 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2…
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 …
## $ rate < dbl > 0.4, 0.7, 1.0, 1.1, 1.4, 1.6, 1.9, 2.2, 2.4, 2.8, 3.4, 4.4, 5.0, 6.5, 7.6, 8.7, 10.4, 12.5, …
## $ weeklyrate < dbl > 0.4, 0.3, 0.3, 0.2, 0.3, 0.3, 0.3, 0.3, 0.2, 0.4, 0.6, 0.9, 0.6, 1.5, 1.1, 1.1, 1.6, 2.1, 3 …
## $ age < int > 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 , 2…
## $ age_label < fct > 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ …
## $ sea_label < chr > "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description < chr > "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid < int > 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…
``` r
glimpse(hospitalizations("eip", "Colorado", years=2015))
```
## Observations: 180
## Variables: 14
## Rows: 270
## Columns: 14
## $ surveillance_area < chr > "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", …
## $ region < chr > "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colora…
## $ year < int > 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
@ -289,20 +289,17 @@ glimpse(hospitalizations("eip", "Colorado", years=2015))
## $ wk_start < date > 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015-1…
## $ wk_end < date > 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015-1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
## $ rate < dbl > 0.0, 0.0, 0.6, 0.6, 0.6, 0.6, 1.2, 1.7, 1.7, 1.7, 1.7, 1.7, 2.9, 3.5, 3.5, 3.5, 4.1, 6.4, 8 …
## $ weeklyrate < dbl > 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.6, 0.6, 0.0, 0.0, 0.0, 0.0, 1.2, 0.6, 0.0, 0.0, 0.6, 2.3 , 2…
## $ age < int > 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2…
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 …
## $ rate < dbl > 0.0, 0.3, 0.6, 0.9, 0.9, 1.3, 1.3, 1.6, 1.6, 2.5, 2.8, 4.4, 6.3, 7.8, 9.7, 10.7, 12.5, 14.7 …
## $ weeklyrate < dbl > 0.0, 0.3, 0.3, 0.3, 0.0, 0.3, 0.0, 0.3, 0.0, 0.9, 0.3, 1.6, 1.9, 1.6, 1.9, 0.9, 1.9, 2.2 , 2…
## $ age < int > 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 , 2…
## $ age_label < fct > 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ …
## $ sea_label < chr > "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description < chr > "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid < int > 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…
``` r
glimpse(hospitalizations("ihsp", years=2015))
```
## Observations: 180
## Variables: 14
## Rows: 270
## Columns: 14
## $ surveillance_area < chr > "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH…
## $ region < chr > "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year < int > 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
@ -310,20 +307,17 @@ glimpse(hospitalizations("ihsp", years=2015))
## $ wk_start < date > 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015-1…
## $ wk_end < date > 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015-1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
## $ rate < dbl > 0.0, 0.0, 0.4, 0.4, 0.4, 1.1, 1.1, 1.1, 1.1, 1.5, 1.8, 2.2, 2.2, 2.6, 2.6, 2.6, 2.9, 4.0, 5 …
## $ weeklyrate < dbl > 0.0, 0.0, 0.4, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.4, 0.4, 0.4, 0.0, 0.4, 0.0, 0.0, 0.4, 1.1, 1 …
## $ age < int > 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2…
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 …
## $ rate < dbl > 0.4, 0.8, 1.0, 1.2, 1.4, 1.4, 1.4, 1.6, 1.8, 2.0, 2.5, 3.1, 3.5, 4.1, 5.1, 6.5, 8.0, 10.0, …
## $ weeklyrate < dbl > 0.4, 0.4, 0.2, 0.2, 0.2, 0.0, 0.0, 0.2, 0.2, 0.2, 0.4, 0.6, 0.4, 0.6, 1.0, 1.4, 1.4, 2.0, 4 …
## $ age < int > 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 , 2…
## $ age_label < fct > 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ yr, 65+ …
## $ sea_label < chr > "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description < chr > "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid < int > 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…
``` r
glimpse(hospitalizations("ihsp", "Oklahoma", years=2015))
```
## Observations: 180
## Variables: 14
## Rows: 270
## Columns: 14
## $ surveillance_area < chr > "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH…
## $ region < chr > "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklaho…
## $ year < int > 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011, 2…
@ -331,13 +325,14 @@ glimpse(hospitalizations("ihsp", "Oklahoma", years=2015))
## $ wk_start < date > 2010-10-03, 2010-10-10, 2010-10-17, 2010-10-24, 2010-10-31, 2010-11-07, 2010-11-14, 2010-1…
## $ wk_end < date > 2010-10-09, 2010-10-16, 2010-10-23, 2010-10-30, 2010-11-06, 2010-11-13, 2010-11-20, 2010-1…
## $ year_wk_num < int > 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, …
## $ rate < dbl > 0.0, 0.0, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 2.4, 2.4, 6.1, 14.6, 17.0, 32.8, 49.9, 76.6, 9 …
## $ weeklyrate < dbl > 0.0, 0.0, 1.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.2, 0.0, 3.6, 8.5, 2.4, 15.8, 17.0, 26.8, 21. …
## $ age < int > 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 …
## $ age_label < fct > 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 yr, 0-4 …
## $ rate < dbl > 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.2, 0.5, 0.7, 0.7, 1.4, 2.3, 2.5, 3.5, 4.6, 6.0, 7.8, 8 …
## $ weeklyrate < dbl > 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.2, 0.2, 0.0, 0.7, 0.9, 0.2, 0.9, 1.2, 1.4, 1.8, 0 …
## $ age < int > 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8 …
## $ age_label < fct > 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 18-49 yr, 1 …
## $ sea_label < chr > "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "20…
## $ sea_description < chr > "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "…
## $ mmwrid < int > 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2…
```
### Retrieve ILINet Surveillance Data
@ -358,10 +353,8 @@ walk(c("national", "hhs", "census", "state"), ~{
print(gg)
})
```
## Observations: 1,111
## Variables: 16
## Rows: 1,173
## Columns: 16
## $ region_type < chr > "National", "National", "National", "National", "National", "National", "National", "Nationa…
## $ region < chr > "National", "National", "National", "National", "National", "National", "National", "Nationa…
## $ year < int > 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, 19…
@ -378,7 +371,7 @@ walk(c("national", "hhs", "census", "state"), ~{
## $ num_of_providers < dbl > 192, 191, 219, 213, 213, 195, 248, 256, 252, 253, 242, 190, 251, 250, 254, 255, 245, 245, 23…
## $ total_patients < dbl > 46842, 48023, 54961, 57044, 55506, 51062, 64463, 66749, 52890, 67887, 61314, 47719, 48429, 5…
## $ week_start < date > 1997-09-28, 1997-10-05, 1997-10-12, 1997-10-19, 1997-10-26, 1997-11-02, 1997-11-09, 1997-11…
## # A tibble: 1,111 x 16
## # A tibble: 1,173 x 16
## region_type region year week weighted_ili unweighted_ili age_0_4 age_25_49 age_25_64 age_5_24 age_50_64 age_65
## < chr > < chr > < int > < int > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 National Natio… 1997 40 1.10 1.22 179 NA 157 205 NA 29
@ -391,13 +384,14 @@ walk(c("national", "hhs", "census", "state"), ~{
## 8 National Natio… 1997 47 2.45 1.65 288 NA 293 456 NA 63
## 9 National Natio… 1997 48 1.74 1.68 268 NA 206 343 NA 69
## 10 National Natio… 1997 49 1.94 1.62 299 NA 282 415 NA 102
## # … with 1,101 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # … with 1,163 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # week_start < date >
```
< img src = "README_files/figure-gfm/ ili-df-1.png" width = "672" / >
< img src = "man/figures/README- ili-df-1.png" width = "672" / >
## Observations: 11,11 0
## Variable s: 16
## Rows: 11,73 0
## Column s: 16
## $ region_type < chr > "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "H…
## $ region < fct > Region 1, Region 2, Region 3, Region 4, Region 5, Region 6, Region 7, Region 8, Region 9, Re…
## $ year < int > 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19…
@ -414,7 +408,7 @@ walk(c("national", "hhs", "census", "state"), ~{
## $ num_of_providers < dbl > 32, 7, 16, 29, 49, 4, 14, 5, 23, 13, 29, 7, 17, 31, 48, 4, 14, 6, 23, 12, 40, 7, 15, 33, 64,…
## $ total_patients < dbl > 7053, 780, 2385, 10222, 9875, 669, 2342, 1183, 10758, 1575, 6987, 872, 2740, 11310, 9618, 68…
## $ week_start < date > 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09…
## # A tibble: 11,11 0 x 16
## # A tibble: 11,73 0 x 16
## region_type region year week weighted_ili unweighted_ili age_0_4 age_25_49 age_25_64 age_5_24 age_50_64 age_65
## < chr > < fct > < int > < int > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 HHS Regions Regio… 1997 40 0.499 0.624 15 NA 7 22 NA 0
@ -427,13 +421,13 @@ walk(c("national", "hhs", "census", "state"), ~{
## 8 HHS Regions Regio… 1997 40 0.516 0.423 2 NA 0 3 NA 0
## 9 HHS Regions Regio… 1997 40 1.81 2.26 80 NA 76 74 NA 13
## 10 HHS Regions Regio… 1997 40 4.74 4.83 31 NA 12 30 NA 3
## # … with 11,10 0 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # … with 11,72 0 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # week_start < date >
< img src = "README_files/figure-gfm/ ili-df-2.png" width = "672" / >
< img src = "man/figures/README- ili-df-2.png" width = "672" / >
## Observations: 9,999
## Variable s: 16
## Rows: 10,557
## Column s: 16
## $ region_type < chr > "Census Regions", "Census Regions", "Census Regions", "Census Regions", "Census Regions", "C…
## $ region < chr > "New England", "Mid-Atlantic", "East North Central", "West North Central", "South Atlantic",…
## $ year < int > 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19…
@ -450,7 +444,7 @@ walk(c("national", "hhs", "census", "state"), ~{
## $ num_of_providers < dbl > 32, 13, 47, 17, 30, 9, 4, 16, 24, 29, 13, 46, 17, 32, 10, 4, 17, 23, 40, 12, 62, 16, 33, 10,…
## $ total_patients < dbl > 7053, 2119, 9649, 2892, 6912, 4356, 669, 10719, 2473, 6987, 2384, 9427, 2823, 7591, 4947, 68…
## $ week_start < date > 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09-28, 1997-09…
## # A tibble: 9,999 x 16
## # A tibble: 10,557 x 16
## region_type region year week weighted_ili unweighted_ili age_0_4 age_25_49 age_25_64 age_5_24 age_50_64 age_65
## < chr > < chr > < int > < int > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 Census Reg… New E… 1997 40 0.499 0.624 15 NA 7 22 NA 0
@ -463,13 +457,13 @@ walk(c("national", "hhs", "census", "state"), ~{
## 8 Census Reg… Mount… 1997 40 2.26 2.28 87 NA 71 71 NA 15
## 9 Census Reg… Pacif… 1997 40 2.05 3.23 26 NA 17 36 NA 1
## 10 Census Reg… New E… 1997 41 0.643 0.816 14 NA 14 29 NA 0
## # … with 9,989 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # … with 10,547 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # week_start < date >
< img src = "README_files/figure-gfm/ ili-df-3.png" width = "672" / >
< img src = "man/figures/README- ili-df-3.png" width = "672" / >
## Observations: 23,120
## Variable s: 16
## Rows: 26,493
## Column s: 16
## $ region_type < chr > "States", "States", "States", "States", "States", "States", "States", "States", "States", "S…
## $ region < chr > "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delawa…
## $ year < int > 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 20…
@ -486,7 +480,7 @@ walk(c("national", "hhs", "census", "state"), ~{
## $ num_of_providers < dbl > 35, 7, 49, 15, 112, 14, 12, 13, 4, NA, 62, 18, 12, 74, 44, 6, 40, 14, 41, 30, 17, 56, 47, 17…
## $ total_patients < dbl > 11664, 1714, 25492, 2586, 32342, 20282, 3831, 3995, 2599, NA, 40314, 1943, 4579, 39390, 1252…
## $ week_start < date > 2010-10-03, 2010-10-03, 2010-10-03, 2010-10-03, 2010-10-03, 2010-10-03, 2010-10-03, 2010-10…
## # A tibble: 23,120 x 16
## # A tibble: 26,493 x 16
## region_type region year week weighted_ili unweighted_ili age_0_4 age_25_49 age_25_64 age_5_24 age_50_64 age_65
## < chr > < chr > < int > < int > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 States Alaba… 2010 40 NA 2.13 NA NA NA NA NA NA
@ -499,33 +493,30 @@ walk(c("national", "hhs", "census", "state"), ~{
## 8 States Delaw… 2010 40 NA 0.100 NA NA NA NA NA NA
## 9 States Distr… 2010 40 NA 2.81 NA NA NA NA NA NA
## 10 States Flori… 2010 40 NA NA NA NA NA NA NA NA
## # … with 23,110 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # … with 26,483 more rows, and 4 more variables: ilitotal < dbl > , num_of_providers < dbl > , total_patients < dbl > ,
## # week_start < date >
< img src = "README_files/figure-gfm/ ili-df-4.png" width = "672" / >
< img src = "man/figures/README- ili-df-4.png" width = "672" / >
### Retrieve weekly state-level ILI indicators per-state for a given season
``` r
ili_weekly_activity_indicators(2017)
```
## # A tibble: 2,805 x 8
## statename url website activity_level activity_level_l… weekend season weeknumber
## statename url website activity_level activity_level_label weekend season weeknumber
## * < chr > < chr > < chr > < dbl > < chr > < date > < chr > < dbl >
## 1 Alabama http://adph.org/influenza/ Influenza Sur… 2 Minimal 2017-10-07 2017-… 40
## 2 Alaska "http://dhss.alaska.gov/dp… Influenza Sur… 1 Minimal 2017-10-07 2017-… 40
## 3 Arizona http://www.azdhs.gov/phs/o… Influenza & R… 2 Minimal 2017-10-07 2017-… 40
## 4 Arkansas http://www.healthy.arkansa… Communicable … 1 Minimal 2017-10-07 2017-… 40
## 5 California https://www.cdph.ca.gov/Pr… Influenza (Fl… 2 Minimal 2017-10-07 2017-… 40
## 6 Colorado https://www.colorado.gov/p… Influenza Sur… 1 Minimal 2017-10-07 2017-… 40
## 7 Connecticut http://www.portal.ct.gov/D… Flu Statistics 1 Minimal 2017-10-07 2017-… 40
## 8 Delaware http://dhss.delaware.gov/d… Weekly Influe… 1 Minimal 2017-10-07 2017-… 40
## 9 District of… http://doh.dc.gov/page/inf… Influenza Inf… 2 Minimal 2017-10-07 2017-… 40
## 10 Florida "http://www.floridahealth.… Weekly Influe… 1 Minimal 2017-10-07 2017-… 40
## 1 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-07 2017-18 40
## 2 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-14 2017-18 41
## 3 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-21 2017-18 42
## 4 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-28 2017-18 43
## 5 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-11-04 2017-18 44
## 6 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-11-11 2017-18 45
## 7 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-02 2017-18 48
## 8 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-09 2017-18 49
## 9 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-23 2017-18 51
## 10 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-30 2017-18 52
## # … with 2,795 more rows
``` r
xdf < - map_df ( 2008:2017 , ili_weekly_activity_indicators )
count(xdf, weekend, activity_level_label) %>%
@ -540,35 +531,32 @@ count(xdf, weekend, activity_level_label) %>%
theme(legend.position="bottom")
```
< img src = "README_files/figure-gfm/ ili-weekly-activity-1.png" width = "960" / >
< img src = "man/figures/README- ili-weekly-activity-1.png" width = "960" / >
### Pneumonia and Influenza Mortality Surveillance
``` r
(nat_pi < - pi_mortality ( " national " ) )
```
## # A tibble: 483 x 19
## # A tibble: 337 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## < chr > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 58 0.055 0.0580 0.0560 1 10 2880 51416 2890
## 2 58 0.0560 0.059 0.055 1 12 2765 50411 2777
## 3 58 0.0560 0.06 0.0560 1 18 2802 50742 2820
## 4 58 0.057 0.061 0.057 1 22 2895 51425 2917
## 5 58 0.0580 0.062 0.0560 1 23 2819 51136 2842
## 6 58 0.059 0.063 0.0560 1 28 2819 50945 2847
## 7 58 0.06 0.064 0.0580 1 25 2953 51618 2978
## 8 58 0.061 0.065 0.057 1 31 2905 51109 2936
## 9 58 0.062 0.066 0.059 1 34 2923 49720 2957
## 10 58 0.064 0.067 0.06 1 48 2857 48381 2905
## # … with 47 3 more rows, and 10 more variables: weeknumber < chr > , geo_description < chr > , age_label < chr > ,
## # wk_start < date > , wk_end < date > , year_wk_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## 1 59 0.053 0.057 0.052 1 16 2702 52444 2718
## 2 59 0.054 0.057 0.053 1 16 2769 52858 2785
## 3 59 0.055 0.0580 0.055 1 18 2976 54120 2994
## 4 59 0.0560 0.059 0.0560 1 30 2984 53906 3014
## 5 59 0.057 0.06 0.054 1 31 2906 53971 2937
## 6 59 0.0580 0.062 0.0560 1 31 3061 55460 3092
## 7 59 0.059 0.063 0.0560 1 39 3092 55679 3131
## 8 59 0.06 0.064 0.054 1 50 2992 55976 3042
## 9 59 0.062 0.065 0.055 1 65 2971 55225 3036
## 10 59 0.063 0.066 0.06 1 99 3305 56974 3404
## # … with 327 more rows, and 10 more variables: weeknumber < chr > , geo_description < chr > , age_label < chr > ,
## # wee k_start < date > , wee k_end < date > , year_wee k_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## # callout < chr >
``` r
select(nat_pi, wk_end, percent_pni, baseline, threshold) %>%
gather(measure, value, -wk_end) %>%
ggplot(aes(wk_end, value)) +
select(nat_pi, week_end, percent_pni, baseline, threshold) %>%
gather(measure, value, -week_end) %>%
ggplot(aes(week_end, value)) +
geom_line(aes(group=measure, color=measure)) +
scale_y_percent() +
scale_color_ipsum(name = NULL, labels=c("Baseline", "Percent P& I", "Threshold")) +
@ -578,79 +566,73 @@ select(nat_pi, wk_end, percent_pni, baseline, threshold) %>%
theme(legend.position="bottom")
```
< img src = "README_files/figure-gfm/ nat-pi-mortality-1.png" width = "672" / >
< img src = "man/figures/README- nat-pi-mortality-1.png" width = "672" / >
``` r
(st_pi < - pi_mortality ( " state " , years = 2015))
```
(st_pi < - pi_mortality ( " state " , years = 2015))
## # A tibble: 2,704 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## < chr > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 55 NA NA 0.047 1 0 46 979 46
## 2 55 NA NA 0.038 0.963 0 34 889 34
## 3 55 NA NA 0.053 1 0 52 978 52
## 4 55 NA NA 0.07 1 0 68 968 68
## 5 55 NA NA 0.053 0.981 0 48 906 48
## 6 55 NA NA 0.0580 1 0 56 968 56
## 7 55 NA NA 0.051 1 0 53 1041 53
## 8 55 NA NA 0.062 1 1 63 1031 64
## 9 55 NA NA 0.0560 1 0 55 976 55
## 10 55 NA NA 0.054 1 0 56 1045 56
## 1 55 NA NA 0.046 0.962 0 43 935 43
## 2 55 NA NA 0.036 0.835 0 29 811 29
## 3 55 NA NA 0.054 0.833 0 44 809 44
## 4 55 NA NA 0.07 0.947 0 64 920 64
## 5 55 NA NA 0.053 0.926 0 48 900 48
## 6 55 NA NA 0.057 0.987 0 55 959 55
## 7 55 NA NA 0.052 1 0 53 1023 53
## 8 55 NA NA 0.063 1 1 62 1002 63
## 9 55 NA NA 0.0560 0.95 0 52 923 52
## 10 55 NA NA 0.054 0.954 0 50 927 50
## # … with 2,694 more rows, and 10 more variables: weeknumber < chr > , geo_description < chr > , age_label < chr > ,
## # wk_start < date > , wk_end < date > , year_wk_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## # wee k_start < date > , wee k_end < date > , year_wee k_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## # callout < chr >
``` r
(reg_pi < - pi_mortality ( " region " , years = 2015))
```
## # A tibble: 520 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## < chr > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl > < dbl >
## 1 55 0.065 0.072 0.07 1 0 178 2525 178
## 1 55 0.064 0.072 0.07 1 0 178 2525 178
## 2 55 0.065 0.073 0.064 1 0 160 2512 160
## 3 55 0.066 0.074 0.0580 1 1 141 2457 142
## 4 55 0.067 0.075 0.07 1 0 171 2426 171
## 5 55 0.068 0.076 0.065 1 2 166 2565 168
## 6 55 0.069 0.077 0.067 1 1 162 2415 163
## 7 55 0.071 0.078 0.079 1 0 198 2491 198
## 8 55 0.072 0.08 0.072 1 1 176 2469 177
## 9 55 0.073 0.081 0.067 1 3 154 2353 157
## 10 55 0.075 0.0820 0.062 1 0 151 2441 151
## 4 55 0.067 0.075 0.07 0.989 0 171 2426 171
## 5 55 0.068 0.077 0.065 1 2 166 2565 168
## 6 55 0.07 0.078 0.067 0.984 1 162 2415 163
## 7 55 0.071 0.079 0.079 1 0 198 2491 198
## 8 55 0.073 0.081 0.072 1 1 176 2468 177
## 9 55 0.074 0.0820 0.067 0.959 3 154 2353 157
## 10 55 0.076 0.084 0.062 0.995 0 151 2441 151
## # … with 510 more rows, and 10 more variables: weeknumber < chr > , geo_description < chr > , age_label < chr > ,
## # wk_start < date > , wk_end < date > , year_wk_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## # wee k_start < date > , wee k_end < date > , year_wee k_num < int > , mmwrid < chr > , coverage_area < chr > , region_name < chr > ,
## # callout < chr >
```
### Retrieve metadata about U.S. State CDC Provider Data
``` r
state_data_providers()
```
## # A tibble: 59 x 5
## statename statehealthdeptname url statewebsitename statefluphonenum
## * < chr > < chr > < chr > < chr > < chr >
## 1 Alabama Alabama Department of Publi… http://adph.org/influenza/ Influenza Surveillance 334-206-5300
## 2 Alaska State of Alaska Health and … "http://dhss.alaska.gov/dph/Epi/… Influenza Surveillance … 907-269-8000
## 3 Arizona Arizona Department of Healt… http://www.azdhs.gov/phs/oids/ep… Influenza & RSV Survei … 602-542-1025
## 4 Arkansas Arkansas Department of Heal… http://www.healthy.arkansas.gov/… Communicable Disease a … 501-661-2000
## 5 California California Department of Pu… https://www.cdph.ca.gov/Programs… Influenza (Flu) 916-558-1784
## 6 Colorado Colorado Department of Publ… https://www.colorado.gov/pacific… Influenza Surveillance 303-692-2000
## 7 Connecticut Connecticut Department of P… http://www.portal.ct.gov/DPH/Inf… Flu Statistics 860-509-8000
## 8 Delaware Delaware Health and Social … http://dhss.delaware.gov/dhss/dp… Weekly Influenza Surve … 302-744-4700
## 9 District of … District of Columbia Depart… http://doh.dc.gov/page/influenza… Influenza Information 202-442-5955
## 10 Florida Florida Department of Health "http://www.floridahealth.gov/di… Weekly Influenza Surve … 850-245-4300
## 1 Alabama Alabama Department of Publi… "http://adph.org/influenza/" Influenza Surveillance 334-206-5300
## 2 Alaska State of Alaska Health and … "http://dhss.alaska.gov/dph/Epi/i … Influenza Surveillanc… 907-269-8000
## 3 Arizona Arizona Department of Healt… " http://www.azdhs.gov/phs/oids/ep… Influenza & RSV Surve… 602-542-1025
## 4 Arkansas Arkansas Department of Heal… " http://www.healthy.arkansas.gov/… Communicable Disease … 501-661-2000
## 5 California California Department of Pu… " https://www.cdph.ca.gov/Programs… Influenza (Flu) 916-558-1784
## 6 Colorado Colorado Department of Publ… " https://www.colorado.gov/pacific… Influenza Surveillance 303-692-2000
## 7 Connecticut Connecticut Department of P… "https://portal.ct.gov/DPH/Epidem… Flu Statistics 860-509-8000
## 8 Delaware Delaware Health and Social … " http://dhss.delaware.gov/dhss/dp… Weekly Influenza Surv… 302-744-4700
## 9 District of … District of Columbia Depart… "https://dchealth.dc.gov/flu " Influenza Information 202-442-5955
## 10 Florida Florida Department of Health "http://www.floridahealth.gov/dis … Weekly Influenza Surv… 850-245-4300
## # … with 49 more rows
```
### Retrieve WHO/NREVSS Surveillance Data
``` r
glimpse(xdat < - who_nrevss ( " national " ) )
```
## List of 3
## $ combined_prior_to_2015_16:Classes 'tbl_df', 'tbl' and 'data.frame': 940 obs. of 14 variables:
## $ combined_prior_to_2015_16: tibble [940 × 14] (S3: tbl_df/tbl/data.frame)
## ..$ region_type : chr [1:940] "National" "National" "National" "National" ...
## ..$ region : chr [1:940] "National" "National" "National" "National" ...
## ..$ year : int [1:940] 1997 1997 1997 1997 1997 1997 1997 1997 1997 1997 ...
@ -665,34 +647,33 @@ glimpse(xdat <- who_nrevss("national"))
## ..$ b : int [1:940] 0 0 1 0 0 0 1 1 1 1 ...
## ..$ h3n2v : int [1:940] 0 0 0 0 0 0 0 0 0 0 ...
## ..$ wk_date : Date[1:940], format: "1997-09-28" "1997-10-05" "1997-10-12" "1997-10-19" ...
## $ public_health_labs :Classes 'tbl_df', 'tbl' and 'data.frame': 171 obs. of 13 variables:
## ..$ region_type : chr [1:171 ] "National" "National" "National" "National" ...
## ..$ region : chr [1:171 ] "National" "National" "National" "National" ...
## ..$ year : int [1:171 ] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
## ..$ week : int [1:171 ] 40 41 42 43 44 45 46 47 48 49 ...
## ..$ total_specimens : int [1:171 ] 1139 1152 1198 1244 1465 1393 1458 1157 1550 1518 ...
## ..$ a_2009_h1n1 : int [1:171 ] 4 5 10 9 4 11 17 17 27 38 ...
## ..$ a_h3 : int [1:171 ] 65 41 50 31 23 34 42 24 36 37 ...
## ..$ a_subtyping_not_performed: int [1:171 ] 2 2 1 4 4 1 1 0 3 3 ...
## ..$ b : int [1:171 ] 10 7 8 9 9 10 4 4 9 11 ...
## ..$ bvic : int [1:171 ] 0 3 3 1 1 4 0 3 3 2 ...
## ..$ byam : int [1:171 ] 1 0 2 4 4 2 4 9 12 11 ...
## ..$ h3n2v : int [1:171 ] 0 0 0 0 0 0 0 0 0 0 ...
## ..$ wk_date : Date[1:171 ], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ...
## $ clinical_labs :Classes 'tbl_df', 'tbl' and 'data.frame': 171 obs. of 11 variables:
## ..$ region_type : chr [1:171 ] "National" "National" "National" "National" ...
## ..$ region : chr [1:171 ] "National" "National" "National" "National" ...
## ..$ year : int [1:171 ] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
## ..$ week : int [1:171 ] 40 41 42 43 44 45 46 47 48 49 ...
## ..$ total_specimens : int [1:171 ] 12029 13111 13441 13537 14687 15048 15250 15234 16201 16673 ...
## ..$ total_a : int [1:171 ] 84 116 97 98 97 122 84 119 145 140 ...
## ..$ total_b : int [1:171 ] 43 54 52 52 68 86 98 92 81 106 ...
## ..$ percent_positive: num [1:171 ] 1.06 1.3 1.11 1.11 1.12 ...
## ..$ percent_a : num [1:171 ] 0.698 0.885 0.722 0.724 0.66 ...
## ..$ percent_b : num [1:171 ] 0.357 0.412 0.387 0.384 0.463 ...
## ..$ wk_date : Date[1:171 ], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ...
## $ public_health_labs : tibble [233 × 13] (S3: tbl_df/tbl/data.frame)
## ..$ region_type : chr [1:233 ] "National" "National" "National" "National" ...
## ..$ region : chr [1:233 ] "National" "National" "National" "National" ...
## ..$ year : int [1:233 ] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
## ..$ week : int [1:233 ] 40 41 42 43 44 45 46 47 48 49 ...
## ..$ total_specimens : int [1:233 ] 1139 1152 1198 1244 1465 1393 1458 1157 1550 1518 ...
## ..$ a_2009_h1n1 : int [1:233 ] 4 5 10 9 4 11 17 17 27 38 ...
## ..$ a_h3 : int [1:233 ] 65 41 50 31 23 34 42 24 36 37 ...
## ..$ a_subtyping_not_performed: int [1:233 ] 2 2 1 4 4 1 1 0 3 3 ...
## ..$ b : int [1:233 ] 10 7 8 9 9 10 4 4 9 11 ...
## ..$ bvic : int [1:233 ] 0 3 3 1 1 4 0 3 3 2 ...
## ..$ byam : int [1:233 ] 1 0 2 4 4 2 4 9 12 11 ...
## ..$ h3n2v : int [1:233 ] 0 0 0 0 0 0 0 0 0 0 ...
## ..$ wk_date : Date[1:233 ], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ...
## $ clinical_labs : tibble [233 × 11] (S3: tbl_df/tbl/data.frame)
## ..$ region_type : chr [1:233 ] "National" "National" "National" "National" ...
## ..$ region : chr [1:233 ] "National" "National" "National" "National" ...
## ..$ year : int [1:233 ] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
## ..$ week : int [1:233 ] 40 41 42 43 44 45 46 47 48 49 ...
## ..$ total_specimens : int [1:233 ] 12029 13111 13441 13537 14687 15048 15250 15234 16201 16673 ...
## ..$ total_a : int [1:233 ] 84 116 97 98 97 122 84 119 145 140 ...
## ..$ total_b : int [1:233 ] 43 54 52 52 68 86 98 92 81 106 ...
## ..$ percent_positive: num [1:233 ] 1.06 1.3 1.11 1.11 1.12 ...
## ..$ percent_a : num [1:233 ] 0.698 0.885 0.722 0.724 0.66 ...
## ..$ percent_b : num [1:233 ] 0.357 0.412 0.387 0.384 0.463 ...
## ..$ wk_date : Date[1:233 ], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ...
``` r
mutate(xdat$combined_prior_to_2015_16,
percent_positive = percent_positive / 100) %>%
ggplot(aes(wk_date, percent_positive)) +
@ -702,12 +683,11 @@ mutate(xdat$combined_prior_to_2015_16,
theme_ipsum_rc(grid="XY")
```
< img src = "README_files/figure-gfm/ who-vrevss-1.png" width = "672" / >
< img src = "man/figures/README- who-vrevss-1.png" width = "672" / >
``` r
who_nrevss("hhs", years=2016)
```
who_nrevss("hhs", years=2016)
## $public_health_labs
## # A tibble: 520 x 13
## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date
@ -740,10 +720,7 @@ who_nrevss("hhs", years=2016)
## 10 HHS Regions Region 10 2016 40 590 14 0 2.37 2.37 0 2016-10-02
## # … with 510 more rows
``` r
who_nrevss("census", years=2016)
```
## $public_health_labs
## # A tibble: 468 x 13
## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date
@ -776,10 +753,7 @@ who_nrevss("census", years=2016)
## 10 Census Regio… New England 2016 41 810 5 1 0.741 0.617 0.123 2016-10-09
## # … with 458 more rows
``` r
who_nrevss("state", years=2016)
```
## $public_health_labs
## # A tibble: 54 x 12
## region_type region season_descript… total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v
@ -811,17 +785,18 @@ who_nrevss("state", years=2016)
## 9 States District of … 2016 40 < NA > < NA > < NA > < NA > < NA > < NA > 2016-10-02
## 10 States Florida 2016 40 < NA > < NA > < NA > < NA > < NA > < NA > 2016-10-02
## # … with 2,798 more rows
```
## cdcfluview Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 21 | 0.91 | 837 | 0.88 | 302 | 0.79 | 521 | 0.85 |
| Rmd | 1 | 0.04 | 83 | 0.09 | 67 | 0.18 | 88 | 0.14 |
| R | 21 | 0.91 | 847 | 0.88 | 303 | 0.79 | 512 | 0.85 |
| Rmd | 1 | 0.04 | 80 | 0.08 | 68 | 0.18 | 86 | 0.14 |
| make | 1 | 0.04 | 32 | 0.03 | 11 | 0.03 | 1 | 0.00 |
## Code of Conduct
Please note that this project is released with a [ Contributor Code of
Conduct](CONDUCT.md) . By participating in this project you agree to
abide by its terms.
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.