diff --git a/.Rbuildignore b/.Rbuildignore index 02c09ed..20efd59 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ +^CRAN-RELEASE$ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ @@ -6,6 +7,7 @@ ^\.codecov\.yml$ ^README_files$ ^doc$ +^docs$ ^CONDUCT\.md$ ^codecov\.yml$ ^.*md$ diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 0000000..a6f23dd --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2019-01-24. +Once it is accepted, delete this file and tag the release (commit 2b6698f1c2). diff --git a/NAMESPACE b/NAMESPACE index 142241e..ebf1673 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,6 +20,7 @@ export(surveillance_areas) export(who_nrevss) import(MMWRweek) import(httr) +import(units) import(xml2) importFrom(dplyr,"%>%") importFrom(dplyr,arrange) diff --git a/R/cdcfluview-package.R b/R/cdcfluview-package.R index bf73efc..29b4171 100644 --- a/R/cdcfluview-package.R +++ b/R/cdcfluview-package.R @@ -11,9 +11,7 @@ #' @name cdcfluview #' @docType package #' @author Bob Rudis (bob@@rud.is) -#' @import httr -#' @import MMWRweek -#' @import xml2 +#' @import httr MMWRweek xml2 units #' @importFrom purrr map map_df map_chr map_lgl discard keep #' @importFrom readr read_csv type_convert #' @importFrom tools file_path_sans_ext diff --git a/cran-comments.md b/cran-comments.md index 51296d5..75dd40d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,8 +1,8 @@ ## Test environments -* local OS X install, R 3.5.1 -* local Ubuntu 16.04 R 3.5.1 -* ubuntu 14.04 (on travis-ci), R old/current/devel +* local OS X install, R 3.5.2 +* local Ubuntu 16.04 R 3.5.2 +* ubuntu 16.04 (on travis-ci), R current/devel * win-builder (devel and release) ## R CMD check results @@ -17,14 +17,14 @@ None --- -The CDC changed their endpoints again and remove support for one of them. The -function had been deprecated in the previous version submitted to CRAN and -had been removed in this version due to the removal from the CDC. +The CDC removed 2 old API endpoints so those functions have been removed. -Support for new endpoints has been added along with tests for these new endpoints. +There was a bug in the computation of "start week" that resulted in +the "ISO" day being used vs the MMWR/"epi" day being used. This +has also been fixed. Only some examples run on CRAN due to their time consuming nature and the need -to make external calls. Weekly tests are performed on Travis-CI - and the package itself has 91% +to make external network API calls. Monthly tests are performed on Travis-CI + and the package itself has 88% code coverage during tests . All package functions are also evaluated on each new generation of the README. \ No newline at end of file diff --git a/docs/CONDUCT.html b/docs/CONDUCT.html new file mode 100644 index 0000000..a36bc84 --- /dev/null +++ b/docs/CONDUCT.html @@ -0,0 +1,130 @@ + + + + + + + + +Contributor Code of Conduct • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+ +

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

+

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

+

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

+

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

+

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

+

This Code of Conduct is adapted from the Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/

+
+ +
+ +
+ + +
+ + +
+

Site built with pkgdown 1.2.0.

+
+
+
+ + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html new file mode 100644 index 0000000..38da14f --- /dev/null +++ b/docs/LICENSE-text.html @@ -0,0 +1,124 @@ + + + + + + + + +License • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
YEAR: 2015-2018
+COPYRIGHT HOLDER: Bob Rudis
+
+ +
+ +
+ + +
+ + +
+

Site built with pkgdown 1.2.0.

+
+
+
+ + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..9b2de7b --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,143 @@ + + + + + + + + +Authors • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
    +
  • +

    Bob Rudis. Author, maintainer. ORCID +

    +
  • +
  • +

    Craig McGowan. Contributor. ORCID +

    +
  • +
  • +

    JJ Chen. Contributor. ORCID +

    +
  • +
  • +

    Sebastian Meyer. Contributor. ORCID +

    +
  • +
  • +

    James Turtle. Contributor. ORCID +

    +
  • +
+ +
+ +
+ + +
+ + +
+

Site built with pkgdown 1.2.0.

+
+
+
+ + + + + + diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..c49581d --- /dev/null +++ b/docs/index.html @@ -0,0 +1,880 @@ + + + + + + + +Retrieve Flu Season Data from the United States Centers for Disease Control + and Prevention ('CDC') 'FluView' Portal • cdcfluview + + + + + + + + + +
+
+ + + +
+
+ +
+ +

The CDC migrated to a new non-Flash portal and back-end APIs changed. This is a complete reimagining of the package and — as such — all your code is going to break…eventually. Older functions have been deprecated with warnings and will be removed at some point.

+

All folks providing feedback, code or suggestions will be added to the DESCRIPTION file. Please include how you would prefer to be cited in any issues you file.

+

If there’s a particular data set from https://www.cdc.gov/flu/weekly/fluviewinteractive.htm that you want and that isn’t in the package, please file it as an issue and be as specific as you can (screen shot if possible).

+
+
+

+:mask: cdcfluview

+

Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention (‘CDC’) ‘FluView’ Portal

+
+

+Description

+

The U.S. Centers for Disease Control (CDC) maintains a portal http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html for accessing state, regional and national influenza statistics as well as Mortality Surveillance Data. The Flash interface makes it difficult and time-consuming to select and retrieve influenza data. This package provides functions to access the data provided by the portal’s underlying API.

+
+
+

+What’s Inside The Tin

+

The following functions are implemented:

+
    +
  • +age_group_distribution: Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories
  • +
  • +cdc_basemap: Retrieve CDC U.S. Basemaps
  • +
  • +geographic_spread: State and Territorial Epidemiologists Reports of Geographic Spread of Influenza
  • +
  • +get_weekly_flu_report: Retrieves (high-level) weekly (XML) influenza surveillance report from the CDC
  • +
  • +hospitalizations: Laboratory-Confirmed Influenza Hospitalizations
  • +
  • +ilinet: Retrieve ILINet Surveillance Data
  • +
  • +ili_weekly_activity_indicators: Retrieve weekly state-level ILI indicators per-state for a given season
  • +
  • +pi_mortality: Pneumonia and Influenza Mortality Surveillance
  • +
  • +state_data_providers: Retrieve metadata about U.S. State CDC Provider Data
  • +
  • +surveillance_areas: Retrieve a list of valid sub-regions for each surveillance area.
  • +
  • +who_nrevss: Retrieve WHO/NREVSS Surveillance Data
  • +
+

MMWR ID Utilities:

+
    +
  • +mmwrid_map: MMWR ID to Calendar Mappings
  • +
  • +mmwr_week: Convert a Date to an MMWR day+week+year
  • +
  • +mmwr_weekday: Convert a Date to an MMWR weekday
  • +
  • +mmwr_week_to_date: Convert an MMWR year+week or year+week+day to a Date object
  • +
+

Deprecated functions:

+
    +
  • +get_flu_data: Retrieves state, regional or national influenza statistics from the CDC (deprecated)
  • +
  • +get_hosp_data: Retrieves influenza hospitalization statistics from the CDC (deprecated)
  • +
  • +get_state_data: Retrieves state/territory-level influenza statistics from the CDC (deprecated)
  • +
+

The following data sets are included:

+
    +
  • +hhs_regions: HHS Region Table (a data frame with 59 rows and 4 variables)
  • +
  • +census_regions: Census Region Table (a data frame with 51 rows and 2 variables)
  • +
  • +mmwrid_map: MMWR ID to Calendar Mappings (it is exported & available, no need to use data())
  • +
+
+
+

+NOTE

+

All development happens in branches now with only critical fixes being back-ported to the master branch when necessary.

+
+
+

+Installation

+
# CRAN
+install.packages("cdcfluview")
+# master branch
+devtools::install_git("https://sr.ht/~hrbrmstr/cdcfluview")
+devtools::install_git("https://gitlab.com/hrbrmstr/cdcfluview")
+devtools::install_github("hrbrmstr/cdcfluview")
+
+
+

+Usage

+
library(cdcfluview)
+library(hrbrthemes)
+library(tidyverse)
+
+# current verison
+packageVersion("cdcfluview")
+
## [1] '0.9.0'
+
+

+Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories

+ +
## Observations: 1,872
+## Variables: 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…
+## $ 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…
+## $ vir_description   <chr> "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "…
+## $ vir_startmmwrid   <int> 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1…
+## $ vir_endmmwrid     <int> 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3…
+## $ 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

+
plot(cdc_basemap("national"))
+

+ +

+
plot(cdc_basemap("census"))
+

+
plot(cdc_basemap("states"))
+

+
plot(cdc_basemap("spread"))
+

+
plot(cdc_basemap("surv"))
+

+
+
+

+State and Territorial Epidemiologists Reports of Geographic Spread of Influenza

+ +
## Observations: 28,151
+## Variables: 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…
+## $ activity_estimate <chr> "No Activity", "No Activity", "No Activity", "Local Activity", "Sporadic", "Sporadic", "Spo…
+## $ 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

+ +
##    surveillance_area               region
+## 1            flusurv       Entire Network
+## 2                eip           California
+## 3                eip             Colorado
+## 4                eip          Connecticut
+## 5                eip       Entire Network
+## 6                eip              Georgia
+## 7                eip             Maryland
+## 8                eip            Minnesota
+## 9                eip           New Mexico
+## 10               eip    New York - Albany
+## 11               eip New York - Rochester
+## 12               eip               Oregon
+## 13               eip            Tennessee
+## 14              ihsp       Entire Network
+## 15              ihsp                Idaho
+## 16              ihsp                 Iowa
+## 17              ihsp             Michigan
+## 18              ihsp                 Ohio
+## 19              ihsp             Oklahoma
+## 20              ihsp         Rhode Island
+## 21              ihsp         South Dakota
+## 22              ihsp                 Utah
+ +
## Observations: 1,746
+## Variables: 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…
+ +

+
glimpse(hospitalizations("eip", years=2015))
+
## Observations: 180
+## Variables: 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…
+## $ season            <int> 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,…
+## $ 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…
+## $ 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…
+
glimpse(hospitalizations("eip", "Colorado", years=2015))
+
## Observations: 180
+## Variables: 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…
+## $ season            <int> 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,…
+## $ 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…
+## $ 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…
+
glimpse(hospitalizations("ihsp", years=2015))
+
## Observations: 180
+## Variables: 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…
+## $ season            <int> 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,…
+## $ 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…
+## $ 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…
+
glimpse(hospitalizations("ihsp", "Oklahoma", years=2015))
+
## Observations: 180
+## Variables: 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…
+## $ season            <int> 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,…
+## $ 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…
+## $ 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

+ +
## Observations: 1,111
+## Variables: 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…
+## $ week             <int> 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1…
+## $ weighted_ili     <dbl> 1.101480, 1.200070, 1.378760, 1.199200, 1.656180, 1.413260, 1.986800, 2.447490, 1.739010, 1.…
+## $ unweighted_ili   <dbl> 1.216860, 1.280640, 1.239060, 1.144730, 1.261120, 1.282750, 1.445790, 1.647960, 1.675170, 1.…
+## $ age_0_4          <dbl> 179, 199, 228, 188, 217, 178, 294, 288, 268, 299, 346, 348, 510, 579, 639, 690, 856, 824, 88…
+## $ age_25_49        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_25_64        <dbl> 157, 151, 153, 193, 162, 148, 240, 293, 206, 282, 268, 235, 404, 584, 759, 654, 679, 817, 76…
+## $ age_5_24         <dbl> 205, 242, 266, 236, 280, 281, 328, 456, 343, 415, 388, 362, 492, 576, 810, 1121, 1440, 1600,…
+## $ age_50_64        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_65           <dbl> 29, 23, 34, 36, 41, 48, 70, 63, 69, 102, 81, 59, 113, 207, 207, 148, 151, 196, 233, 146, 119…
+## $ ilitotal         <dbl> 570, 615, 681, 653, 700, 655, 932, 1100, 886, 1098, 1083, 1004, 1519, 1946, 2415, 2613, 3126…
+## $ 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
+##    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
+##  2 National    Natio…  1997    41         1.20           1.28     199        NA       151      242        NA     23
+##  3 National    Natio…  1997    42         1.38           1.24     228        NA       153      266        NA     34
+##  4 National    Natio…  1997    43         1.20           1.14     188        NA       193      236        NA     36
+##  5 National    Natio…  1997    44         1.66           1.26     217        NA       162      280        NA     41
+##  6 National    Natio…  1997    45         1.41           1.28     178        NA       148      281        NA     48
+##  7 National    Natio…  1997    46         1.99           1.45     294        NA       240      328        NA     70
+##  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>,
+## #   week_start <date>
+

+
## Observations: 11,110
+## Variables: 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…
+## $ week             <int> 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, …
+## $ weighted_ili     <dbl> 0.498535, 0.374963, 1.354280, 0.400338, 1.229260, 1.018980, 0.871791, 0.516017, 1.807610, 4.…
+## $ unweighted_ili   <dbl> 0.623848, 0.384615, 1.341720, 0.450010, 0.901266, 0.747384, 1.152860, 0.422654, 2.258780, 4.…
+## $ age_0_4          <dbl> 15, 0, 6, 12, 31, 2, 0, 2, 80, 31, 14, 0, 4, 21, 36, 2, 0, 0, 103, 19, 35, 0, 3, 19, 66, 2, …
+## $ age_25_49        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_25_64        <dbl> 7, 3, 7, 23, 24, 1, 4, 0, 76, 12, 14, 2, 19, 7, 23, 2, 0, 1, 76, 7, 15, 0, 17, 15, 29, 2, 3,…
+## $ age_5_24         <dbl> 22, 0, 15, 11, 30, 2, 18, 3, 74, 30, 29, 0, 16, 14, 41, 2, 13, 8, 84, 35, 35, 0, 24, 18, 75,…
+## $ age_50_64        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_65           <dbl> 0, 0, 4, 0, 4, 0, 5, 0, 13, 3, 0, 0, 3, 2, 4, 0, 2, 0, 11, 1, 0, 1, 2, 2, 16, 0, 2, 0, 9, 2,…
+## $ ilitotal         <dbl> 44, 3, 32, 46, 89, 5, 27, 5, 243, 76, 57, 2, 42, 44, 104, 6, 15, 9, 274, 62, 85, 1, 46, 54, …
+## $ 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,110 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
+##  2 HHS Regions Regio…  1997    40        0.375          0.385       0        NA         3        0        NA      0
+##  3 HHS Regions Regio…  1997    40        1.35           1.34        6        NA         7       15        NA      4
+##  4 HHS Regions Regio…  1997    40        0.400          0.450      12        NA        23       11        NA      0
+##  5 HHS Regions Regio…  1997    40        1.23           0.901      31        NA        24       30        NA      4
+##  6 HHS Regions Regio…  1997    40        1.02           0.747       2        NA         1        2        NA      0
+##  7 HHS Regions Regio…  1997    40        0.872          1.15        0        NA         4       18        NA      5
+##  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,100 more rows, and 4 more variables: ilitotal <dbl>, num_of_providers <dbl>, total_patients <dbl>,
+## #   week_start <date>
+

+
## Observations: 9,999
+## Variables: 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…
+## $ week             <int> 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, …
+## $ weighted_ili     <dbl> 0.4985350, 0.8441440, 0.7924860, 1.7640500, 0.5026620, 0.0542283, 1.0189800, 2.2587800, 2.04…
+## $ unweighted_ili   <dbl> 0.6238480, 1.3213800, 0.8187380, 1.2793900, 0.7233800, 0.0688705, 0.7473840, 2.2763300, 3.23…
+## $ age_0_4          <dbl> 15, 4, 28, 3, 14, 0, 2, 87, 26, 14, 4, 36, 0, 21, 0, 2, 93, 29, 35, 3, 65, 1, 19, 0, 2, 84, …
+## $ age_25_49        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_25_64        <dbl> 7, 8, 20, 8, 22, 3, 1, 71, 17, 14, 13, 23, 1, 14, 1, 2, 72, 11, 15, 11, 27, 5, 21, 0, 2, 55,…
+## $ age_5_24         <dbl> 22, 12, 28, 20, 14, 0, 2, 71, 36, 29, 8, 39, 18, 22, 0, 2, 80, 44, 35, 16, 74, 9, 24, 2, 2, …
+## $ age_50_64        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_65           <dbl> 0, 4, 3, 6, 0, 0, 0, 15, 1, 0, 2, 2, 4, 3, 0, 0, 10, 2, 0, 3, 12, 6, 2, 0, 0, 9, 2, 0, 1, 14…
+## $ ilitotal         <dbl> 44, 28, 79, 37, 50, 3, 5, 244, 80, 57, 27, 100, 23, 60, 1, 6, 255, 86, 85, 33, 178, 21, 66, …
+## $ 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
+##    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
+##  2 Census Reg… Mid-A…  1997    40       0.844          1.32         4        NA         8       12        NA      4
+##  3 Census Reg… East …  1997    40       0.792          0.819       28        NA        20       28        NA      3
+##  4 Census Reg… West …  1997    40       1.76           1.28         3        NA         8       20        NA      6
+##  5 Census Reg… South…  1997    40       0.503          0.723       14        NA        22       14        NA      0
+##  6 Census Reg… East …  1997    40       0.0542         0.0689       0        NA         3        0        NA      0
+##  7 Census Reg… West …  1997    40       1.02           0.747        2        NA         1        2        NA      0
+##  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>,
+## #   week_start <date>
+

+
## Observations: 23,120
+## Variables: 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…
+## $ week             <int> 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, …
+## $ weighted_ili     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ unweighted_ili   <dbl> 2.1347700, 0.8751460, 0.6747210, 0.6960560, 1.9541200, 0.6606840, 0.0783085, 0.1001250, 2.80…
+## $ age_0_4          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_25_49        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_25_64        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_5_24         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_50_64        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ age_65           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
+## $ ilitotal         <dbl> 249, 15, 172, 18, 632, 134, 3, 4, 73, NA, 647, 20, 19, 505, 65, 10, 39, 19, 391, 22, 117, 16…
+## $ 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
+##    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
+##  2 States      Alaska  2010    40           NA         0.875       NA        NA        NA       NA        NA     NA
+##  3 States      Arizo…  2010    40           NA         0.675       NA        NA        NA       NA        NA     NA
+##  4 States      Arkan…  2010    40           NA         0.696       NA        NA        NA       NA        NA     NA
+##  5 States      Calif…  2010    40           NA         1.95        NA        NA        NA       NA        NA     NA
+##  6 States      Color…  2010    40           NA         0.661       NA        NA        NA       NA        NA     NA
+##  7 States      Conne…  2010    40           NA         0.0783      NA        NA        NA       NA        NA     NA
+##  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>,
+## #   week_start <date>
+

+
+
+

+Retrieve weekly state-level ILI indicators per-state for a given season

+ +
## # A tibble: 2,805 x 8
+##    statename    url                         website        activity_level activity_level_l… 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
+## # … with 2,795 more rows
+ +

+
+
+

+Pneumonia and Influenza Mortality Surveillance

+ +
## # A tibble: 483 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 473 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>,
+## #   callout <chr>
+ +

+
(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
+## # … 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>,
+## #   callout <chr>
+
(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
+##  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
+## # … 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>,
+## #   callout <chr>
+
+
+

+Retrieve metadata about U.S. State CDC Provider Data

+ +
## # 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    
+## # … with 49 more rows
+
+
+

+Retrieve WHO/NREVSS Surveillance Data

+ +
## List of 3
+##  $ combined_prior_to_2015_16:Classes 'tbl_df', 'tbl' and 'data.frame':   940 obs. of  14 variables:
+##   ..$ 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 ...
+##   ..$ week                     : int [1:940] 40 41 42 43 44 45 46 47 48 49 ...
+##   ..$ total_specimens          : int [1:940] 1291 1513 1552 1669 1897 2106 2204 2533 2242 2607 ...
+##   ..$ percent_positive         : num [1:940] 0 0.727 1.095 0.419 0.527 ...
+##   ..$ a_2009_h1n1              : int [1:940] 0 0 0 0 0 0 0 0 0 0 ...
+##   ..$ a_h1                     : int [1:940] 0 0 0 0 0 0 0 0 0 0 ...
+##   ..$ a_h3                     : int [1:940] 0 0 3 0 9 0 3 5 14 11 ...
+##   ..$ a_subtyping_not_performed: int [1:940] 0 11 13 7 1 6 4 17 22 28 ...
+##   ..$ a_unable_to_subtype      : int [1:940] 0 0 0 0 0 0 0 0 0 0 ...
+##   ..$ 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" ...
+ +

+
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   
+##    <chr>       <chr>   <int> <int>           <int>       <int> <int>            <int> <int> <int> <int> <int> <date>    
+##  1 HHS Regions Region…  2016    40              31           0     6                0     0     0     0     0 2016-10-02
+##  2 HHS Regions Region…  2016    40              31           0     6                0     0     2     0     0 2016-10-02
+##  3 HHS Regions Region…  2016    40             112           2     2                0     0     0     0     0 2016-10-02
+##  4 HHS Regions Region…  2016    40             112           1    11                0     1     2     0     0 2016-10-02
+##  5 HHS Regions Region…  2016    40             204           0     7                0     0     0     1     0 2016-10-02
+##  6 HHS Regions Region…  2016    40              39           1     1                0     0     0     0     0 2016-10-02
+##  7 HHS Regions Region…  2016    40              24           0     2                0     0     1     0     0 2016-10-02
+##  8 HHS Regions Region…  2016    40              46           2     8                0     0     0     0     0 2016-10-02
+##  9 HHS Regions Region…  2016    40             186           3    27                0     0     0     3     0 2016-10-02
+## 10 HHS Regions Region…  2016    40             113           0    17                0     0     0     0     0 2016-10-02
+## # … with 510 more rows
+## 
+## $clinical_labs
+## # A tibble: 520 x 11
+##    region_type region     year  week total_specimens total_a total_b percent_positive percent_a percent_b wk_date   
+##    <chr>       <chr>     <int> <int>           <int>   <int>   <int>            <dbl>     <dbl>     <dbl> <date>    
+##  1 HHS Regions Region 1   2016    40             654       5       1            0.917     0.765     0.153 2016-10-02
+##  2 HHS Regions Region 2   2016    40            1307      10       3            0.995     0.765     0.230 2016-10-02
+##  3 HHS Regions Region 3   2016    40             941       1       4            0.531     0.106     0.425 2016-10-02
+##  4 HHS Regions Region 4   2016    40            2960      46      63            3.68      1.55      2.13  2016-10-02
+##  5 HHS Regions Region 5   2016    40            2386       8       5            0.545     0.335     0.210 2016-10-02
+##  6 HHS Regions Region 6   2016    40            1914      22      13            1.83      1.15      0.679 2016-10-02
+##  7 HHS Regions Region 7   2016    40             723       0       0            0         0         0     2016-10-02
+##  8 HHS Regions Region 8   2016    40             913       8       0            0.876     0.876     0     2016-10-02
+##  9 HHS Regions Region 9   2016    40             992       6       1            0.706     0.605     0.101 2016-10-02
+## 10 HHS Regions Region 10  2016    40             590      14       0            2.37      2.37      0     2016-10-02
+## # … with 510 more rows
+
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   
+##    <chr>        <chr>  <int> <int>           <int>       <int> <int>            <int> <int> <int> <int> <int> <date>    
+##  1 Census Regi… New E…  2016    40              31           0     6                0     0     0     0     0 2016-10-02
+##  2 Census Regi… Mid-A…  2016    40              50           0     8                0     0     2     0     0 2016-10-02
+##  3 Census Regi… East …  2016    40             139           0     4                0     0     0     1     0 2016-10-02
+##  4 Census Regi… West …  2016    40             103           0     6                0     0     1     0     0 2016-10-02
+##  5 Census Regi… South…  2016    40             181           3    11                0     1     2     0     0 2016-10-02
+##  6 Census Regi… East …  2016    40              24           0     0                0     0     0     0     0 2016-10-02
+##  7 Census Regi… West …  2016    40              27           0     1                0     0     0     0     0 2016-10-02
+##  8 Census Regi… Mount…  2016    40              54           3    10                0     0     0     1     0 2016-10-02
+##  9 Census Regi… Pacif…  2016    40             289           3    41                0     0     0     2     0 2016-10-02
+## 10 Census Regi… New E…  2016    41              14           0     2                0     0     0     0     0 2016-10-09
+## # … with 458 more rows
+## 
+## $clinical_labs
+## # A tibble: 468 x 11
+##    region_type   region       year  week total_specimens total_a total_b percent_positive percent_a percent_b wk_date   
+##    <chr>         <chr>       <int> <int>           <int>   <int>   <int>            <dbl>     <dbl>     <dbl> <date>    
+##  1 Census Regio… New England  2016    40             654       5       1            0.917     0.765    0.153  2016-10-02
+##  2 Census Regio… Mid-Atlant…  2016    40            1579      10       4            0.887     0.633    0.253  2016-10-02
+##  3 Census Regio… East North…  2016    40            2176       6       5            0.506     0.276    0.230  2016-10-02
+##  4 Census Regio… West North…  2016    40            1104       3       0            0.272     0.272    0      2016-10-02
+##  5 Census Regio… South Atla…  2016    40            2785      43      62            3.77      1.54     2.23   2016-10-02
+##  6 Census Regio… East South…  2016    40             844       4       4            0.948     0.474    0.474  2016-10-02
+##  7 Census Regio… West South…  2016    40            1738      21      13            1.96      1.21     0.748  2016-10-02
+##  8 Census Regio… Mountain     2016    40            1067       8       0            0.750     0.750    0      2016-10-02
+##  9 Census Regio… Pacific      2016    40            1433      20       1            1.47      1.40     0.0698 2016-10-02
+## 10 Census Regio… New England  2016    41             810       5       1            0.741     0.617    0.123  2016-10-09
+## # … with 458 more rows
+
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
+##    <chr>       <chr>  <chr>            <chr>           <chr>       <chr> <chr>            <chr> <chr> <chr> <chr>
+##  1 States      Alaba… Season 2016-17   570             3           227   1                2     15    14    0    
+##  2 States      Alaska Season 2016-17   5222            14          905   3                252   2     11    0    
+##  3 States      Arizo… Season 2016-17   2975            63          1630  0                5     227   578   0    
+##  4 States      Arkan… Season 2016-17   121             0           51    0                0     4     0     0    
+##  5 States      Calif… Season 2016-17   14074           184         4696  120              116   28    152   0    
+##  6 States      Color… Season 2016-17   714             3           267   2                4     31    219   0    
+##  7 States      Conne… Season 2016-17   1348            19          968   0                0     62    263   0    
+##  8 States      Delaw… Season 2016-17   3090            5           659   4                11    27    127   1    
+##  9 States      Distr… Season 2016-17   73              1           34    0                3     0     4     0    
+## 10 States      Flori… Season 2016-17   <NA>            <NA>        <NA>  <NA>             <NA>  <NA>  <NA>  <NA> 
+## # … with 44 more rows, and 1 more variable: wk_date <date>
+## 
+## $clinical_labs
+## # A tibble: 2,808 x 11
+##    region_type region         year  week total_specimens total_a total_b percent_positive percent_a percent_b wk_date   
+##    <chr>       <chr>         <int> <int> <chr>           <chr>   <chr>   <chr>            <chr>     <chr>     <date>    
+##  1 States      Alabama        2016    40 406             4       1       1.23             0.99      0.25      2016-10-02
+##  2 States      Alaska         2016    40 <NA>            <NA>    <NA>    <NA>             <NA>      <NA>      2016-10-02
+##  3 States      Arizona        2016    40 133             0       0       0                0         0         2016-10-02
+##  4 States      Arkansas       2016    40 47              0       0       0                0         0         2016-10-02
+##  5 States      California     2016    40 668             2       0       0.3              0.3       0         2016-10-02
+##  6 States      Colorado       2016    40 260             0       0       0                0         0         2016-10-02
+##  7 States      Connecticut    2016    40 199             3       0       1.51             1.51      0         2016-10-02
+##  8 States      Delaware       2016    40 40              0       0       0                0         0         2016-10-02
+##  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(%)
R210.918410.883030.805090.85
Rmd10.04800.08670.18870.15
make10.04320.03110.0310.00
+
+
+

+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.

+
+
+
+ + +
+ + +
+ +
+

Site built with pkgdown 1.2.0.

+
+
+
+ + + + + diff --git a/docs/index_files/figure-html/cdc-basemaps-1.png b/docs/index_files/figure-html/cdc-basemaps-1.png new file mode 100644 index 0000000..5580ff5 Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-1.png differ diff --git a/docs/index_files/figure-html/cdc-basemaps-2.png b/docs/index_files/figure-html/cdc-basemaps-2.png new file mode 100644 index 0000000..c35ffa9 Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-2.png differ diff --git a/docs/index_files/figure-html/cdc-basemaps-3.png b/docs/index_files/figure-html/cdc-basemaps-3.png new file mode 100644 index 0000000..796a68b Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-3.png differ diff --git a/docs/index_files/figure-html/cdc-basemaps-4.png b/docs/index_files/figure-html/cdc-basemaps-4.png new file mode 100644 index 0000000..cbcb332 Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-4.png differ diff --git a/docs/index_files/figure-html/cdc-basemaps-5.png b/docs/index_files/figure-html/cdc-basemaps-5.png new file mode 100644 index 0000000..722359c Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-5.png differ diff --git a/docs/index_files/figure-html/cdc-basemaps-6.png b/docs/index_files/figure-html/cdc-basemaps-6.png new file mode 100644 index 0000000..12669d3 Binary files /dev/null and b/docs/index_files/figure-html/cdc-basemaps-6.png differ diff --git a/docs/index_files/figure-html/ili-df-1.png b/docs/index_files/figure-html/ili-df-1.png new file mode 100644 index 0000000..79485cc Binary files /dev/null and b/docs/index_files/figure-html/ili-df-1.png differ diff --git a/docs/index_files/figure-html/ili-df-2.png b/docs/index_files/figure-html/ili-df-2.png new file mode 100644 index 0000000..ab7d335 Binary files /dev/null and b/docs/index_files/figure-html/ili-df-2.png differ diff --git a/docs/index_files/figure-html/ili-df-3.png b/docs/index_files/figure-html/ili-df-3.png new file mode 100644 index 0000000..663b24d Binary files /dev/null and b/docs/index_files/figure-html/ili-df-3.png differ diff --git a/docs/index_files/figure-html/ili-df-4.png b/docs/index_files/figure-html/ili-df-4.png new file mode 100644 index 0000000..d284a24 Binary files /dev/null and b/docs/index_files/figure-html/ili-df-4.png differ diff --git a/docs/index_files/figure-html/ili-weekly-activity-1.png b/docs/index_files/figure-html/ili-weekly-activity-1.png new file mode 100644 index 0000000..f05572e Binary files /dev/null and b/docs/index_files/figure-html/ili-weekly-activity-1.png differ diff --git a/docs/index_files/figure-html/nat-pi-mortality-1.png b/docs/index_files/figure-html/nat-pi-mortality-1.png new file mode 100644 index 0000000..4a3f1cd Binary files /dev/null and b/docs/index_files/figure-html/nat-pi-mortality-1.png differ diff --git a/docs/index_files/figure-html/surveillance-areas-1.png b/docs/index_files/figure-html/surveillance-areas-1.png new file mode 100644 index 0000000..15ac472 Binary files /dev/null and b/docs/index_files/figure-html/surveillance-areas-1.png differ diff --git a/docs/index_files/figure-html/who-vrevss-1.png b/docs/index_files/figure-html/who-vrevss-1.png new file mode 100644 index 0000000..9292a06 Binary files /dev/null and b/docs/index_files/figure-html/who-vrevss-1.png differ diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 0000000..d484ba1 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,189 @@ + + + + + + + + +Changelog • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+

+cdcfluview 0.9.0 2019-01-24 +

+
    +
  • fix bug in epiweek computation in ilinet() thanks to a bug report by @jturtle (#19)
  • +
  • included cloc metrics and refreshed README
  • +
  • +
  • +
+
+
+

+cdcfluview 0.7.0 2017-11-14 +

+
    +
  • The CDC changed most of their API endpoints to support a new HTML interface and re-jiggered the back-end API. Craig McGowan updated the old cdcfluview API function to account for the changes. However, the new API endpoints provided additional data features and it seemed to make sense to revamp the package to fit more in line with the way the APIs were structured. Legacy cdcfluview functions have been deprecated and will display deprecation messages when run. The new cdcfluview package API changes a few things about how you work with the data but the README and examples show how to work with it.
  • +
+
+
+

+cdcfluview 0.5.2 Unreleased +

+
    +
  • Modified behavior of get_flu_data() to actually grab current flu season year if a single year was specified and it is the current year and the return is a 0 length data frame (fixes #7)
  • +
  • Added code coverage tests for all API functions.
  • +
+
+
+

+cdcfluview 0.5.1 2016-12-07 +

+
    +
  • Replaced http URLs with https as http ones no longer work (fixes #6)
  • +
  • Fixed State data download (CDC changed the hidden API)
  • +
+
+
+

+cdcfluview 0.5.0 Unreleased +

+
    +
  • Fixed issue with WHO data format change
  • +
  • Added Mortality Surveillance Data retrieval function
  • +
  • Switched to readr::read_csv() and since it handles column names better this will break your scripts until you use the new column names.
  • +
+
+
+

+cdcfluview 0.4.0 2015-08-09 +

+
    +
  • First CRAN release
  • +
+
+
+ + + +
+ +
+ + +
+

Site built with pkgdown 1.2.0.

+
+
+
+ + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..2e4f0cf --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,236 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; + + padding-top: 60px; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +img { + max-width: 100%; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents h1.page-header { + margin-top: calc(-60px + 1em); +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + margin-left: -30px; + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Static header placement on mobile devices */ +@media (max-width: 767px) { + .navbar-fixed-top { + position: absolute; + } + .navbar { + padding: 0; + } +} + + +/* Sidebar --------------------------*/ + +#sidebar { + margin-top: 30px; +} +#sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#sidebar h2:first-child { + margin-top: 0; +} + +#sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +.orcid { + height: 16px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top;} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} + +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + +pre .img { + margin: 5px 0; +} + +pre .img img { + background-color: #fff; + display: block; + height: auto; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..706ad58 --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,110 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $("#sidebar") + .stick_in_parent({offset_top: 40}) + .on('sticky_kit:bottom', function(e) { + $(this).parent().css('position', 'static'); + }) + .on('sticky_kit:unbottom', function(e) { + $(this).parent().css('position', 'relative'); + }); + + $('body').scrollspy({ + target: '#sidebar', + offset: 60 + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(0); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 1 : 0); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..8be84ef --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,5 @@ +pandoc: 2.3.1 +pkgdown: 1.2.0 +pkgdown_sha: ~ +articles: [] + diff --git a/docs/reference/age_group_distribution.html b/docs/reference/age_group_distribution.html new file mode 100644 index 0000000..d9ed7cf --- /dev/null +++ b/docs/reference/age_group_distribution.html @@ -0,0 +1,170 @@ + + + + + + + + +Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories — age_group_distribution • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Retrieves the age group distribution of influenza positive tests that are reported by +public health laboratories by influenza virus type and subtype/lineage. Laboratory data +from multiple seasons and different age groups is provided.

    + +
    + +
    age_group_distribution(years = NULL)
    + +

    Arguments

    + + + + + + +
    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 1997. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    References

    + + + + +

    Examples

    +
    agd <- age_group_distribution(years=2015)
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/cdc_basemap.html b/docs/reference/cdc_basemap.html new file mode 100644 index 0000000..0fc53c3 --- /dev/null +++ b/docs/reference/cdc_basemap.html @@ -0,0 +1,180 @@ + + + + + + + + +Retrieve CDC U.S. Basemaps — cdc_basemap • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The CDC FluView application uses a composite basemaps of coverage areas +within the United States that elides and scales Alaska, Hawaii, +Puerto Rico & the Virgin Islands and some further provide elided and scaled +breakouts for New York City and the District of Columbia.
    +
    +This function retrieves the given shapefile, projects to EPSG:5069 and +returns it as an sf (simple features) object.

    + +
    + +
    cdc_basemap(basemap = c("national", "hhs", "census", "states", "spread",
    +  "surv"))
    + +

    Arguments

    + + + + + + +
    basemap

    select the CDC basemap. One of:

      +
    • "national": outline of the U.S. + AK, HI, PR + VI

    • +
    • "hhs": outline of the U.S. + HHS Region Outlines + AK, HI, PR + VI

    • +
    • "census": outline of the U.S. + Census Region Outlines + AK, HI, PR + VI

    • +
    • "states": outline of the U.S. + State Outlines + AK, HI, PR + VI

    • +
    • "spread": outline of the U.S. + State Outlines + AK, HI, PR + VI & Guam

    • +
    • "surv": outline of the U.S. + State Outlines + AK, HI, PR + VI

    • +
    + +

    Note

    + +

    These are just the basemaps. You need to pair it with the data you wish to visualize.

    + + +

    Examples

    +
    # NOT RUN {
    +plot(cdc_basemap("national"))
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/cdcfluview.html b/docs/reference/cdcfluview.html new file mode 100644 index 0000000..7bf073e --- /dev/null +++ b/docs/reference/cdcfluview.html @@ -0,0 +1,149 @@ + + + + + + + + +Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal — cdcfluview • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The U.S. Centers for Disease Control (CDC) maintains a portal +http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html for +accessing state, regional and national influenza statistics as well as +Mortality Surveillance Data. The Flash interface makes it difficult and +time-consuming to select and retrieve influenza data. This package +provides functions to access the data provided by the portal's underlying API.

    + +
    + + + +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/census_regions.html b/docs/reference/census_regions.html new file mode 100644 index 0000000..17ac8f2 --- /dev/null +++ b/docs/reference/census_regions.html @@ -0,0 +1,168 @@ + + + + + + + + +Census Region Table — census_regions • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    This dataset contains the states belonging to the (presently) 4 + U.S. Census regions in "long" format. It consists of a data.frame + with the following columns:

    +
      +
    • region: the official Census region name (e.g. "East")

    • +
    • state: state belonging to the region

    • +
    + +
    + +
    data(census_regions)
    + +

    Format

    + +

    A data frame with 51 rows and 2 variables

    + +

    Note

    + +

    Last updated 2015-08-09.

    + +

    References

    + +

    https://www.cdc.gov/std/stats12/images/CensusMap.png

    + + +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/geographic_spread.html b/docs/reference/geographic_spread.html new file mode 100644 index 0000000..54d3949 --- /dev/null +++ b/docs/reference/geographic_spread.html @@ -0,0 +1,160 @@ + + + + + + + + +State and Territorial Epidemiologists Reports of Geographic Spread of Influenza — geographic_spread • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    State and Territorial Epidemiologists Reports of Geographic Spread of Influenza

    + +
    + +
    geographic_spread(years = NULL)
    + +

    Arguments

    + + + + + + +
    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 2003 +and up until the current, active flu season. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + + +

    Examples

    +
    # NOT RUN {
    +gs <- geographic_spread()
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/get_flu_data.html b/docs/reference/get_flu_data.html new file mode 100644 index 0000000..211bd90 --- /dev/null +++ b/docs/reference/get_flu_data.html @@ -0,0 +1,203 @@ + + + + + + + + +Retrieves state, regional or national influenza statistics from the CDC (deprecated) — get_flu_data • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Uses the data source from the +CDC FluView +and provides flu reporting data as either a single data frame or a list of +data frames (depending on whether either WHO NREVSS or ILINet +(or both) is chosen.

    + +
    + +
    get_flu_data(region = "hhs", sub_region = 1:10,
    +  data_source = "ilinet", years = as.numeric(format(Sys.Date(),
    +  "%Y")))
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    region

    one of "hhs", "census", "national", +"state"

    sub_region

    depends on the region_type.
    +For "national", the sub_region should be NA.
    +For "hhs", should be a vector between 1:10.
    +For "census", should be a vector between 1:9.
    +For "state", should be a vector of state/territory names +or "all".

    data_source

    either of "who" (for WHO NREVSS) or "ilinet" +or "all" (for both)

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). Default value is the current year and all +years values should be > 1997

    + +

    Value

    + +

    If only a single data_source is specified, then a single + data.frame is returned, otherwise a named list with each + data.frame is returned.

    + +

    Details

    + +

    A lookup table between HHS regions and their member states/territories +is provided in hhs_regions.

    + +

    Note

    + +

    There is often a noticeable delay when making the API request to the CDC. + This is not due to a large download size, but the time it takes for their + servers to crunch the data. Wrap the function call in httr::with_verbose + if you would like to see what's going on.

    + + +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/get_hosp_data.html b/docs/reference/get_hosp_data.html new file mode 100644 index 0000000..d2df9aa --- /dev/null +++ b/docs/reference/get_hosp_data.html @@ -0,0 +1,190 @@ + + + + + + + + +Retrieves influenza hospitalization statistics from the CDC (deprecated) — get_hosp_data • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Uses the data source from the +CDC FluView +and provides influenza hospitalization reporting data as a data frame.

    + +
    + +
    get_hosp_data(area = "flusurvnet", age_group = "overall",
    +  years = as.numeric(format(Sys.Date(), "%Y")) - 1)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    area

    one of "flusurvnet", "eip", "ihsp", or two +digit state abbreviation for an individual site. Exceptions are +New York - Albany ("nya") and New York - Rochester +("nyr")

    age_group

    a vector of age groups to pull data for. Possible values are: +"overall", "0-4y", "5-17y, "18-49y, +"50-64y, "65+y".

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). Default value is the current year and all +years values should be >= 2009

    + +

    Value

    + +

    A single data.frame.

    + +

    Note

    + +

    There is often a noticeable delay when making the API request to the CDC. + This is not due to a large download size, but the time it takes for their + servers to crunch the data. Wrap the function call in httr::with_verbose + if you would like to see what's going on.

    + + +

    Examples

    +
    # NOT RUN {
    +# All of FluSurv-NET, 50-64 years old, 2010/11-2014/15 flu seasons
    +hosp <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014)
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/get_state_data.html b/docs/reference/get_state_data.html new file mode 100644 index 0000000..a1b964b --- /dev/null +++ b/docs/reference/get_state_data.html @@ -0,0 +1,186 @@ + + + + + + + + +Retrieves state/territory-level influenza statistics from the CDC (deprecated) — get_state_data • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Uses the data source from the CDC' State-levelFluView +https://gis.cdc.gov/grasp/fluview/main.html and provides state flu +reporting data as a single data frame.
    +
    +This function provides similar data to get_weekly_flu_report but +provides more metadata about the reporting sources and has access to more +historical infomation.

    + +
    + +
    get_state_data(years = as.numeric(format(Sys.Date(), "%Y")))
    + +

    Arguments

    + + + + + + +
    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). Default value is the current year and all +years values should be >= 2008

    + +

    Value

    + +

    A data.frame of state-level data for the specified seasons + (also classed as cdcstatedata)

    + +

    Note

    + +

    There is often a noticeable delay when making the API request to the CDC. This + is not due to a large download size, but the time it takes for their + servers to crunch the data. Wrap the function call in httr::with_verbose + if you would like to see what's going on.

    + + +

    Examples

    +
    state_data <- get_state_data(2014)
    #> This function has been deprecated and will be removed in future releases. +#> Use ili_weekly_activity_indicators() instead.
    # NOT RUN { +gsd <- get_state_data(c(2013, 2014)) +gsd <- get_state_data(2010:2014) +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/get_weekly_flu_report.html b/docs/reference/get_weekly_flu_report.html new file mode 100644 index 0000000..34dbb94 --- /dev/null +++ b/docs/reference/get_weekly_flu_report.html @@ -0,0 +1,172 @@ + + + + + + + + +Retrieves (high-level) weekly (XML) influenza surveillance report from the CDC — get_weekly_flu_report • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The CDC publishes a weekly +influenza report detailing high-level flu activity per-state. They also +publish a data file (see References) of historical report readings. +This function reads that XML file and produces a long data_frame +with the historical surveillance readings.
    +
    +This function provides similar data to get_state_data but without +the reporting source metadata and a limit on the historical flu information.

    + +
    + +
    get_weekly_flu_report()
    + +

    Value

    + +

    tbl_df (also classed with cdcweeklyreport) with six + columns: year, week_number, state, color, + label, subtitle

    + +

    References

    + +

    https://www.cdc.gov/flu/weekly/flureport.xml

    + + +

    Examples

    +
    # NOT RUN {
    +wfr <- get_weekly_flu_report()
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/hhs_regions.html b/docs/reference/hhs_regions.html new file mode 100644 index 0000000..5542776 --- /dev/null +++ b/docs/reference/hhs_regions.html @@ -0,0 +1,174 @@ + + + + + + + + +HHS Region Table — hhs_regions • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    This dataset contains the names, numbers, regional offices for-, + and states/territories belonging to the (presently) 10 HHS U.S. + regions in "long" format. It consists of a data.frame + with the following columns:

    +
      +
    • region: the official HHS region name (e.g. "Region 1")

    • +
    • region_number: the associated region number

    • +
    • regional_office: the HHS regional office for the entire region

    • +
    • state_or_territory: state or territory belonging to the region

    • +
    + +
    + +
    data(hhs_regions)
    + +

    Format

    + +

    A data frame with 59 rows and 4 variables

    + +

    Note

    + +

    Last updated 2015-08-09.

    + +

    References

    + +

    https://www.hhs.gov/about/agencies/iea/regional-offices/index.html

    + + +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/hospitalizations.html b/docs/reference/hospitalizations.html new file mode 100644 index 0000000..e82fa36 --- /dev/null +++ b/docs/reference/hospitalizations.html @@ -0,0 +1,181 @@ + + + + + + + + +Laboratory-Confirmed Influenza Hospitalizations — hospitalizations • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Laboratory-Confirmed Influenza Hospitalizations

    + +
    + +
    hospitalizations(surveillance_area = c("flusurv", "eip", "ihsp"),
    +  region = "all", years = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    surveillance_area

    one of "flusurv", "eip", or "ihsp"

    region

    Using "all" mimics selecting "Entire Network" from the +CDC FluView application drop down. Individual regions for each +surveillance area can also be selected. Use surveillance_areas() to +see a list of valid sub-regions for each surveillance area.

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 2009 +and up until the previous flu season. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 56 == 2016-2017) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    References

    + + + + +

    Examples

    +
    hosp_fs <- hospitalizations("flusurv", years=2015)
    # NOT RUN { +hosp_eip <- hospitalizations("eip") +hosp_ihsp <- hospitalizations("ihsp") +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/ili_weekly_activity_indicators.html b/docs/reference/ili_weekly_activity_indicators.html new file mode 100644 index 0000000..1cf0b59 --- /dev/null +++ b/docs/reference/ili_weekly_activity_indicators.html @@ -0,0 +1,186 @@ + + + + + + + + +Retrieve weekly state-level ILI indicators per-state for a given season — ili_weekly_activity_indicators • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Retrieve weekly state-level ILI indicators per-state for a given season

    + +
    + +
    ili_weekly_activity_indicators(years = NULL)
    + +

    Arguments

    + + + + + + +
    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 2008 +and up until the current, active flu season. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    Note

    + +

    These statistics use the proportion of outpatient visits to healthcare providers +for influenza-like illness to measure the ILI activity level within a state. They do +not, however, measure the extent of geographic spread of flu within a state. Therefore, +outbreaks occurring in a single city could cause the state to display high activity levels.
    +
    +Data collected in ILINet may disproportionately represent certain populations within +a state, and therefore may not accurately depict the full picture of influenza activity +for the whole state.
    +
    +All summary statistics are based on either data collected in ILINet, or reports from +state and territorial epidemiologists. Differences in the summary data presented by +CDC and state health departments likely represent differing levels of data completeness +with data presented by the state likely being the more complete.

    + +

    References

    + + + + +

    Examples

    +
    # NOT RUN {
    +iwai <- ili_weekly_activity_indicators(2016)
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/ilinet.html b/docs/reference/ilinet.html new file mode 100644 index 0000000..0e414b7 --- /dev/null +++ b/docs/reference/ilinet.html @@ -0,0 +1,191 @@ + + + + + + + + +Retrieve ILINet Surveillance Data — ilinet • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The CDC FluView Portal provides in-season and past seasons' national, regional, +and state-level outpatient illness and viral surveillance data from both +ILINet (Influenza-like Illness Surveillance Network) and WHO/NREVSS +(National Respiratory and Enteric Virus Surveillance System).

    + +
    + +
    ilinet(region = c("national", "hhs", "census", "state"), years = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    region

    one of "national", "hhs", "census", or "state"

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 1997. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    Details

    + +

    This function retrieves current and historical ILINet surveillance data for +the identified region.

    + +

    References

    + + + + +

    Examples

    +
    national_ili <- ilinet("national", years = 2017)
    # NOT RUN { +hhs_ili <- ilinet("hhs") +census_ili <- ilinet("census") +state_ili <- ilinet("state") + +all_ili <- suppressWarnings( + suppressMessages(purrr::map_df(c("national", "hhs", "census", "state"), ilinet))) +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..783462b --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,269 @@ + + + + + + + + +Function reference • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    age_group_distribution()

    +

    Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories

    +

    cdc_basemap()

    +

    Retrieve CDC U.S. Basemaps

    +

    cdcfluview

    +

    Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal

    +

    census_regions

    +

    Census Region Table

    +

    geographic_spread()

    +

    State and Territorial Epidemiologists Reports of Geographic Spread of Influenza

    +

    get_flu_data()

    +

    Retrieves state, regional or national influenza statistics from the CDC (deprecated)

    +

    get_hosp_data()

    +

    Retrieves influenza hospitalization statistics from the CDC (deprecated)

    +

    get_state_data()

    +

    Retrieves state/territory-level influenza statistics from the CDC (deprecated)

    +

    get_weekly_flu_report()

    +

    Retrieves (high-level) weekly (XML) influenza surveillance report from the CDC

    +

    hhs_regions

    +

    HHS Region Table

    +

    hospitalizations()

    +

    Laboratory-Confirmed Influenza Hospitalizations

    +

    ili_weekly_activity_indicators()

    +

    Retrieve weekly state-level ILI indicators per-state for a given season

    +

    ilinet()

    +

    Retrieve ILINet Surveillance Data

    +

    mmwr_week()

    +

    Convert a Date to an MMWR day+week+year

    +

    mmwr_week_to_date()

    +

    Convert an MMWR year+week or year+week+day to a Date object

    +

    mmwr_weekday()

    +

    Convert a Date to an MMWR weekday

    +

    mmwrid_map

    +

    MMWR ID to Calendar Mappings

    +

    pi_mortality()

    +

    Pneumonia and Influenza Mortality Surveillance

    +

    state_data_providers()

    +

    Retrieve metadata about U.S. State CDC Provider Data

    +

    surveillance_areas()

    +

    Retrieve a list of valid sub-regions for each surveillance area.

    +

    who_nrevss()

    +

    Retrieve WHO/NREVSS Surveillance Data

    +
    + + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/mmwr_week.html b/docs/reference/mmwr_week.html new file mode 100644 index 0000000..bbc46f9 --- /dev/null +++ b/docs/reference/mmwr_week.html @@ -0,0 +1,160 @@ + + + + + + + + +Convert a Date to an MMWR day+week+year — mmwr_week • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    This is a reformat and re-export of a function in the MMWRweek package. +It provides a snake case version of its counterpart, produces a tibble

    + +
    + +
    mmwr_week(x)
    + +

    Arguments

    + + + + + + +
    x

    a vector of Date objects or a character vector in YYYY-mm-dd format.

    + +

    Value

    + +

    data frame (tibble)

    + + +

    Examples

    +
    mwk <- mmwr_week(Sys.Date())
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/mmwr_week_to_date.html b/docs/reference/mmwr_week_to_date.html new file mode 100644 index 0000000..65547ad --- /dev/null +++ b/docs/reference/mmwr_week_to_date.html @@ -0,0 +1,165 @@ + + + + + + + + +Convert an MMWR year+week or year+week+day to a Date object — mmwr_week_to_date • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    This is a reformat and re-export of a function in the MMWRweek package. +It provides a snake case version of its counterpart and produces a vector +of Date objects that corresponds to the input MMWR year+week or year+week+day +vectors. This also adds some parameter checking and cleanup to avoid exceptions.

    + +
    + +
    mmwr_week_to_date(year, week, day = NULL)
    + +

    Arguments

    + + + + + + +
    year, week, day

    Year, week and month vectors. All must be the same length +unless day is NULL.

    + +

    Value

    + +

    vector of Date objects

    + + +

    Examples

    +
    mwd <- mmwr_week_to_date(2016,10,3)
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/mmwr_weekday.html b/docs/reference/mmwr_weekday.html new file mode 100644 index 0000000..179eb7c --- /dev/null +++ b/docs/reference/mmwr_weekday.html @@ -0,0 +1,174 @@ + + + + + + + + +Convert a Date to an MMWR weekday — mmwr_weekday • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    This is a reformat and re-export of a function in the MMWRweek package. +It provides a snake case version of its counterpart, produces a factor of +weekday names (Sunday-Saturday).

    + +
    + +
    mmwr_weekday(x, abbr = FALSE)
    + +

    Arguments

    + + + + + + + + + + +
    x

    a vector of Date objects or a character vector in YYYY-mm-dd format.

    abbr

    (logical) if TRUE, return abbreviated weekday names, otherwise full +weekday names (see Note).

    + +

    Value

    + +

    ordered factor

    + +

    Note

    + +

    Weekday names are explicitly mapped to "Sunday-Saturday" or "Sun-Sat" and +do not change with your locale.

    + + +

    Examples

    +
    mwday <- mmwr_weekday(Sys.Date())
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/mmwrid_map.html b/docs/reference/mmwrid_map.html new file mode 100644 index 0000000..f9a444b --- /dev/null +++ b/docs/reference/mmwrid_map.html @@ -0,0 +1,161 @@ + + + + + + + + +MMWR ID to Calendar Mappings — mmwrid_map • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The CDC uses a unique "Morbidity and Mortality Weekly Report" identifier +for each week that starts at 1 (Ref: < https://www.cdc.gov/mmwr/preview/mmwrhtml/su6004a9.htm>). +This data frame consists of 4 columns:

      +
    • wk_start: Start date (Sunday) for the week (Date)

    • +
    • wk_end: End date (Saturday) for the week (Date)

    • +
    • year_wk_num: The week of the calendar year

    • +
    • mmwrid: The unique MMWR identifier +These can be "left-joined" to data provided from the CDC to perform MMWR identifier +to date mappings.

    • +
    + +
    + + +

    Format

    + +

    A data frame with 4,592 rows and 4 columns

    + + +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/pi_mortality.html b/docs/reference/pi_mortality.html new file mode 100644 index 0000000..c75519f --- /dev/null +++ b/docs/reference/pi_mortality.html @@ -0,0 +1,231 @@ + + + + + + + + +Pneumonia and Influenza Mortality Surveillance — pi_mortality • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The National Center for Health Statistics (NCHS) collects and disseminates the Nation's +official vital statistics. NCHS collects death certificate data from state vital +statistics offices for virtually all deaths occurring in the United States. Pneumonia +and influenza (P&I) deaths are identified based on ICD-10 +multiple cause of death codes.
    +
    +NCHS Mortality Surveillance System data are presented by the week the death occurred +at the national, state, and HHS Region levels. Data on the percentage of deaths due +to P&I on a national level are released two weeks after the week of death to allow +for collection of enough data to produce a stable percentage. States and HHS regions +with less than 20 +reported by week during 2008-2012) will be marked as insufficient data. Collection +of complete data is not expected at the time of initial report, and a reliable +percentage of deaths due to P&I is not anticipated at the U.S. Department of Health +and Human Services region or state level within this two week period. The data for +earlier weeks are continually revised and the proportion of deaths due to P&I may +increase or decrease as new and updated death certificate data are received by NCHS.
    +
    +The seasonal baseline of P&I deaths is calculated using a periodic regression model +that incorporates a robust regression procedure applied to data from the previous +five years. An increase of 1.645 standard deviations above the seasonal baseline +of P&I deaths is considered the "epidemic threshold," i.e., the point at which +the observed proportion of deaths attributed to pneumonia or influenza was +significantly higher than would be expected at that time of the year in the +absence of substantial influenza-related mortality. Baselines and thresholds are +calculated at the national and regional level and by age group.

    + +
    + +
    pi_mortality(coverage_area = c("national", "state", "region"),
    +  years = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    coverage_area

    coverage area for data (national, state or region)

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 2009 +and up until the current, active flu season. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    Note

    + +

    Queries for "state" and "region" are not necessarily as "instantaneous" as other API endpoints and can near or over 30s retrieval delays.

    + +

    References

    + + + + +

    Examples

    +
    # NOT RUN {
    +ndf <- pi_mortality()
    +sdf <- pi_mortality("state")
    +rdf <- pi_mortality("region")
    +# }
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/state_data_providers.html b/docs/reference/state_data_providers.html new file mode 100644 index 0000000..31888f5 --- /dev/null +++ b/docs/reference/state_data_providers.html @@ -0,0 +1,142 @@ + + + + + + + + +Retrieve metadata about U.S. State CDC Provider Data — state_data_providers • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Retrieve metadata about U.S. State CDC Provider Data

    + +
    + +
    state_data_providers()
    + + +

    Examples

    +
    sdp <- state_data_providers()
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/surveillance_areas.html b/docs/reference/surveillance_areas.html new file mode 100644 index 0000000..02227b8 --- /dev/null +++ b/docs/reference/surveillance_areas.html @@ -0,0 +1,142 @@ + + + + + + + + +Retrieve a list of valid sub-regions for each surveillance area. — surveillance_areas • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Retrieve a list of valid sub-regions for each surveillance area.

    + +
    + +
    surveillance_areas()
    + + +

    Examples

    +
    sa <- surveillance_areas()
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.2.0.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/who_nrevss.html b/docs/reference/who_nrevss.html new file mode 100644 index 0000000..d61de00 --- /dev/null +++ b/docs/reference/who_nrevss.html @@ -0,0 +1,212 @@ + + + + + + + + +Retrieve WHO/NREVSS Surveillance Data — who_nrevss • cdcfluview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    The CDC FluView Portal provides in-season and past seasons' national, regional, +and state-level outpatient illness and viral surveillance data from both +ILINet (Influenza-like Illness Surveillance Network) and WHO/NREVSS +(National Respiratory and Enteric Virus Surveillance System).

    + +
    + +
    who_nrevss(region = c("national", "hhs", "census", "state"),
    +  years = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    region

    one of "national", "hhs", "census", or "state"

    years

    a vector of years to retrieve data for (i.e. 2014 for CDC +flu season 2014-2015). CDC has data for this API going back to 1997. +Default value (NULL) means retrieve all years. NOTE: if you +happen to specify a 2-digit season value (i.e. 57 == 2017-2018) +the function is smart enough to retrieve by season ID vs convert that +to a year.

    + +

    Value

    + +

    list of data frames identified by

      +
    • combined_prior_to_2015_16

    • +
    • public_health_labs

    • +
    • clinical_labs

    • +
    + + +

    Details

    + +

    This function retrieves current and historical WHO/NREVSS surveillance data for +the identified region.

    + +

    Note

    + +

    HHS, Census and State data retrieval is not as "instantaneous" as their ILINet +counterparts.

    +Also, beginning for the 2015-16 season, reports from public health and clinical +laboratories are presented separately in the weekly influenza update. This is +the reason why a list of data frames is returned.

    +ALSO The new CDC API seems to be missing some public health lab data fields.

    + +

    References

    + + + + +

    Examples

    +
    # NOT RUN {
    +national_who <- who_nrevss("national")
    +hhs_who <- who_nrevss("hhs")
    +census_who <- who_nrevss("census")
    +state_who <- who_nrevss("state")
    +# }
    +
    + +
    + + +
    + + + + + +