Browse Source

pkgdown

pull/22/head
boB Rudis 2 years ago
parent
commit
28c0494609
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
52 changed files with 6043 additions and 12 deletions
  1. +2
    -0
      .Rbuildignore
  2. +2
    -0
      CRAN-RELEASE
  3. +1
    -0
      NAMESPACE
  4. +1
    -3
      R/cdcfluview-package.R
  5. +9
    -9
      cran-comments.md
  6. +130
    -0
      docs/CONDUCT.html
  7. +124
    -0
      docs/LICENSE-text.html
  8. +143
    -0
      docs/authors.html
  9. +148
    -0
      docs/docsearch.css
  10. +85
    -0
      docs/docsearch.js
  11. +880
    -0
      docs/index.html
  12. BIN
      docs/index_files/figure-html/cdc-basemaps-1.png
  13. BIN
      docs/index_files/figure-html/cdc-basemaps-2.png
  14. BIN
      docs/index_files/figure-html/cdc-basemaps-3.png
  15. BIN
      docs/index_files/figure-html/cdc-basemaps-4.png
  16. BIN
      docs/index_files/figure-html/cdc-basemaps-5.png
  17. BIN
      docs/index_files/figure-html/cdc-basemaps-6.png
  18. BIN
      docs/index_files/figure-html/ili-df-1.png
  19. BIN
      docs/index_files/figure-html/ili-df-2.png
  20. BIN
      docs/index_files/figure-html/ili-df-3.png
  21. BIN
      docs/index_files/figure-html/ili-df-4.png
  22. BIN
      docs/index_files/figure-html/ili-weekly-activity-1.png
  23. BIN
      docs/index_files/figure-html/nat-pi-mortality-1.png
  24. BIN
      docs/index_files/figure-html/surveillance-areas-1.png
  25. BIN
      docs/index_files/figure-html/who-vrevss-1.png
  26. +12
    -0
      docs/link.svg
  27. +189
    -0
      docs/news/index.html
  28. +236
    -0
      docs/pkgdown.css
  29. +110
    -0
      docs/pkgdown.js
  30. +5
    -0
      docs/pkgdown.yml
  31. +170
    -0
      docs/reference/age_group_distribution.html
  32. +180
    -0
      docs/reference/cdc_basemap.html
  33. +149
    -0
      docs/reference/cdcfluview.html
  34. +168
    -0
      docs/reference/census_regions.html
  35. +160
    -0
      docs/reference/geographic_spread.html
  36. +203
    -0
      docs/reference/get_flu_data.html
  37. +190
    -0
      docs/reference/get_hosp_data.html
  38. +186
    -0
      docs/reference/get_state_data.html
  39. +172
    -0
      docs/reference/get_weekly_flu_report.html
  40. +174
    -0
      docs/reference/hhs_regions.html
  41. +181
    -0
      docs/reference/hospitalizations.html
  42. +186
    -0
      docs/reference/ili_weekly_activity_indicators.html
  43. +191
    -0
      docs/reference/ilinet.html
  44. +269
    -0
      docs/reference/index.html
  45. +160
    -0
      docs/reference/mmwr_week.html
  46. +165
    -0
      docs/reference/mmwr_week_to_date.html
  47. +174
    -0
      docs/reference/mmwr_weekday.html
  48. +161
    -0
      docs/reference/mmwrid_map.html
  49. +231
    -0
      docs/reference/pi_mortality.html
  50. +142
    -0
      docs/reference/state_data_providers.html
  51. +142
    -0
      docs/reference/surveillance_areas.html
  52. +212
    -0
      docs/reference/who_nrevss.html

+ 2
- 0
.Rbuildignore View File

@ -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$


+ 2
- 0
CRAN-RELEASE View File

@ -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).

+ 1
- 0
NAMESPACE View File

@ -20,6 +20,7 @@ export(surveillance_areas)
export(who_nrevss)
import(MMWRweek)
import(httr)
import(units)
import(xml2)
importFrom(dplyr,"%>%")
importFrom(dplyr,arrange)


+ 1
- 3
R/cdcfluview-package.R View File

@ -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


+ 9
- 9
cran-comments.md View File

@ -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
<https://travis-ci.org/hrbrmstr/cdcfluview> and the package itself has 91%
to make external network API calls. Monthly tests are performed on Travis-CI
<https://travis-ci.org/hrbrmstr/cdcfluview> and the package itself has 88%
code coverage during tests <https://codecov.io/github/hrbrmstr/cdcfluview?branch=master>.
All package functions are also evaluated on each new generation of the README.

+ 130
- 0
docs/CONDUCT.html View File

@ -0,0 +1,130 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contributor Code of Conduct • cdcfluview</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="Contributor Code of Conduct" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-title-body">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">cdcfluview</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Contributor Code of Conduct</h1>
</div>
<div id="contributor-code-of-conduct" class="section level1">
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.</p>
<p>This Code of Conduct is adapted from the Contributor Covenant (<a href="http:contributor-covenant.org" class="uri">http:contributor-covenant.org</a>), version 1.0.0, available at <a href="http://contributor-covenant.org/version/1/0/0/" class="uri">http://contributor-covenant.org/version/1/0/0/</a></p>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.2.0.</p>
</div>
</footer>
</div>
</body>
</html>

+ 124
- 0
docs/LICENSE-text.html View File

@ -0,0 +1,124 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>License • cdcfluview</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="License" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-title-body">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">cdcfluview</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>License</h1>
</div>
<pre>YEAR: 2015-2018
COPYRIGHT HOLDER: Bob Rudis
</pre>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.2.0.</p>
</div>
</footer>
</div>
</body>
</html>

+ 143
- 0
docs/authors.html View File

@ -0,0 +1,143 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Authors • cdcfluview</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="Authors" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-authors">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">cdcfluview</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Authors</h1>
</div>
<ul class="list-unstyled">
<li>
<p><strong>Bob Rudis</strong>. Author, maintainer. <a href='https://orcid.org/0000-0001-5670-2640' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID' height='16'></a>
</p>
</li>
<li>
<p><strong>Craig McGowan</strong>. Contributor. <a href='https://orcid.org/0000-0002-6298-0185' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID' height='16'></a>
</p>
</li>
<li>
<p><strong>JJ Chen</strong>. Contributor. <a href='https://orcid.org/0000-0001-8482-8398' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID' height='16'></a>
</p>
</li>
<li>
<p><strong>Sebastian Meyer</strong>. Contributor. <a href='https://orcid.org/0000-0002-1791-9449' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID' height='16'></a>
</p>
</li>
<li>
<p><strong>James Turtle</strong>. Contributor. <a href='https://orcid.org/0000-0003-0735-7769' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID' height='16'></a>
</p>
</li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.2.0.</p>
</div>
</footer>
</div>
</body>
</html>

+ 148
- 0
docs/docsearch.css
File diff suppressed because it is too large
View File


+ 85
- 0
docs/docsearch.js View File

@ -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;
}

+ 880
- 0
docs/index.html View File

@ -0,0 +1,880 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Retrieve Flu Season Data from the United States Centers for Disease Control
and Prevention ('CDC') 'FluView' Portal • cdcfluview</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Retrieve Flu Season Data from the United States Centers for Disease Control
and Prevention ('CDC') 'FluView' Portal">
<meta property="og:description" content="The 'U.S.' Centers for Disease Control and Prevention (CDC) maintain
a portal &lt;http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html&gt; for
accessing state, regional and national influenza statistics as well as
mortality surveillance data. The web interface makes it difficult and
time-consuming to select and retrieve influenza data. Tools are provided
to access the data provided by the portal's underlying 'API'.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">cdcfluview</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div id="i-m-p-o-r-t-a-n-t" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#i-m-p-o-r-t-a-n-t" class="anchor"></a>I M P O R T A N T</h1></div>
<p>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.</p>
<p>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.</p>
<p>If there’s a particular data set from <a href="https://www.cdc.gov/flu/weekly/fluviewinteractive.htm" class="uri">https://www.cdc.gov/flu/weekly/fluviewinteractive.htm</a> 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).</p>
</div>
<div id="mask-cdcfluview" class="section level1">
<h1 class="hasAnchor">
<a href="#mask-cdcfluview" class="anchor"></a>:mask: cdcfluview</h1>
<p>Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention (‘CDC’) ‘FluView’ Portal</p>
<div id="description" class="section level2">
<h2 class="hasAnchor">
<a href="#description" class="anchor"></a>Description</h2>
<p>The U.S. Centers for Disease Control (CDC) maintains a portal <a href="http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html" class="uri">http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html</a> 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.</p>
</div>
<div id="whats-inside-the-tin" class="section level2">
<h2 class="hasAnchor">
<a href="#whats-inside-the-tin" class="anchor"></a>What’s Inside The Tin</h2>
<p>The following functions are implemented:</p>
<ul>
<li>
<code>age_group_distribution</code>: Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories</li>
<li>
<code>cdc_basemap</code>: Retrieve CDC U.S. Basemaps</li>
<li>
<code>geographic_spread</code>: State and Territorial Epidemiologists Reports of Geographic Spread of Influenza</li>
<li>
<code>get_weekly_flu_report</code>: Retrieves (high-level) weekly (XML) influenza surveillance report from the CDC</li>
<li>
<code>hospitalizations</code>: Laboratory-Confirmed Influenza Hospitalizations</li>
<li>
<code>ilinet</code>: Retrieve ILINet Surveillance Data</li>
<li>
<code>ili_weekly_activity_indicators</code>: Retrieve weekly state-level ILI indicators per-state for a given season</li>
<li>
<code>pi_mortality</code>: Pneumonia and Influenza Mortality Surveillance</li>
<li>
<code>state_data_providers</code>: Retrieve metadata about U.S. State CDC Provider Data</li>
<li>
<code>surveillance_areas</code>: Retrieve a list of valid sub-regions for each surveillance area.</li>
<li>
<code>who_nrevss</code>: Retrieve WHO/NREVSS Surveillance Data</li>
</ul>
<p>MMWR ID Utilities:</p>
<ul>
<li>
<code>mmwrid_map</code>: MMWR ID to Calendar Mappings</li>
<li>
<code>mmwr_week</code>: Convert a Date to an MMWR day+week+year</li>
<li>
<code>mmwr_weekday</code>: Convert a Date to an MMWR weekday</li>
<li>
<code>mmwr_week_to_date</code>: Convert an MMWR year+week or year+week+day to a Date object</li>
</ul>
<p>Deprecated functions:</p>
<ul>
<li>
<code>get_flu_data</code>: Retrieves state, regional or national influenza statistics from the CDC (deprecated)</li>
<li>
<code>get_hosp_data</code>: Retrieves influenza hospitalization statistics from the CDC (deprecated)</li>
<li>
<code>get_state_data</code>: Retrieves state/territory-level influenza statistics from the CDC (deprecated)</li>
</ul>
<p>The following data sets are included:</p>
<ul>
<li>
<code>hhs_regions</code>: HHS Region Table (a data frame with 59 rows and 4 variables)</li>
<li>
<code>census_regions</code>: Census Region Table (a data frame with 51 rows and 2 variables)</li>
<li>
<code>mmwrid_map</code>: MMWR ID to Calendar Mappings (it is exported &amp; available, no need to use <code><a href="https://www.rdocumentation.org/packages/utils/topics/data">data()</a></code>)</li>
</ul>
</div>
<div id="note" class="section level2">
<h2 class="hasAnchor">
<a href="#note" class="anchor"></a>NOTE</h2>
<p>All development happens in branches now with only critical fixes being back-ported to the master branch when necessary.</p>
</div>
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="co"># CRAN</span></a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"cdcfluview"</span>)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="co"># master branch</span></a>
<a class="sourceLine" id="cb1-4" data-line-number="4">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_git</a></span>(<span class="st">"https://sr.ht/~hrbrmstr/cdcfluview"</span>)</a>
<a class="sourceLine" id="cb1-5" data-line-number="5">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_git</a></span>(<span class="st">"https://gitlab.com/hrbrmstr/cdcfluview"</span>)</a>
<a class="sourceLine" id="cb1-6" data-line-number="6">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"hrbrmstr/cdcfluview"</span>)</a></code></pre></div>
</div>
<div id="usage" class="section level2">
<h2 class="hasAnchor">
<a href="#usage" class="anchor"></a>Usage</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(cdcfluview)</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(hrbrthemes)</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tidyverse)</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"></a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="co"># current verison</span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/packageDescription">packageVersion</a></span>(<span class="st">"cdcfluview"</span>)</a></code></pre></div>
<pre><code>## [1] '0.9.0'</code></pre>
<div id="age-group-distribution-of-influenza-positive-tests-reported-by-public-health-laboratories" class="section level3">
<h3 class="hasAnchor">
<a href="#age-group-distribution-of-influenza-positive-tests-reported-by-public-health-laboratories" class="anchor"></a>Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/age_group_distribution.html">age_group_distribution</a></span>(<span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## Observations: 1,872
## Variables: 16
## $ sea_label &lt;chr&gt; "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ age_label &lt;fct&gt; 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 &lt;fct&gt; A (Subtyping not Performed), A (Subtyping not Performed), A (Subtyping not Performed), A (S…
## $ count &lt;int&gt; 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 &lt;int&gt; 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…
## $ seasonid &lt;int&gt; 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,…
## $ publishyearweekid &lt;int&gt; 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2…
## $ sea_description &lt;chr&gt; "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ sea_startweek &lt;int&gt; 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2…
## $ sea_endweek &lt;int&gt; 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2…
## $ vir_description &lt;chr&gt; "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "…
## $ vir_startmmwrid &lt;int&gt; 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1…
## $ vir_endmmwrid &lt;int&gt; 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3…
## $ wk_start &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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, …</code></pre>
</div>
<div id="retrieve-cdc-u-s--coverage-map" class="section level3">
<h3 class="hasAnchor">
<a href="#retrieve-cdc-u-s--coverage-map" class="anchor"></a>Retrieve CDC U.S. Coverage Map</h3>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"national"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-1.png" width="700"></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"hhs"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-2.png" width="700"></p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"census"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-3.png" width="700"></p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"states"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-4.png" width="700"></p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"spread"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-5.png" width="700"></p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(<span class="kw"><a href="reference/cdc_basemap.html">cdc_basemap</a></span>(<span class="st">"surv"</span>))</a></code></pre></div>
<p><img src="index_files/figure-html/cdc-basemaps-6.png" width="700"></p>
</div>
<div id="state-and-territorial-epidemiologists-reports-of-geographic-spread-of-influenza" class="section level3">
<h3 class="hasAnchor">
<a href="#state-and-territorial-epidemiologists-reports-of-geographic-spread-of-influenza" class="anchor"></a>State and Territorial Epidemiologists Reports of Geographic Spread of Influenza</h3>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/geographic_spread.html">geographic_spread</a></span>())</a></code></pre></div>
<pre><code>## Observations: 28,151
## Variables: 7
## $ statename &lt;chr&gt; "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Al…
## $ url &lt;chr&gt; "http://adph.org/influenza/", "http://adph.org/influenza/", "http://adph.org/influenza/", "…
## $ website &lt;chr&gt; "Influenza Surveillance", "Influenza Surveillance", "Influenza Surveillance", "Influenza Su…
## $ activity_estimate &lt;chr&gt; "No Activity", "No Activity", "No Activity", "Local Activity", "Sporadic", "Sporadic", "Spo…
## $ weekend &lt;date&gt; 2003-10-04, 2003-10-11, 2003-10-18, 2003-10-25, 2003-11-01, 2003-11-08, 2003-11-15, 2003-1…
## $ season &lt;chr&gt; "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "20…
## $ weeknumber &lt;chr&gt; "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "1", "2…</code></pre>
</div>
<div id="laboratory-confirmed-influenza-hospitalizations" class="section level3">
<h3 class="hasAnchor">
<a href="#laboratory-confirmed-influenza-hospitalizations" class="anchor"></a>Laboratory-Confirmed Influenza Hospitalizations</h3>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="kw"><a href="reference/surveillance_areas.html">surveillance_areas</a></span>()</a></code></pre></div>
<pre><code>## 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</code></pre>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1"><span class="kw">glimpse</span>(fs_nat &lt;-<span class="st"> </span><span class="kw"><a href="reference/hospitalizations.html">hospitalizations</a></span>(<span class="st">"flusurv"</span>))</a></code></pre></div>
<pre><code>## Observations: 1,746
## Variables: 14
## $ surveillance_area &lt;chr&gt; "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "…
## $ region &lt;chr&gt; "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year &lt;int&gt; 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2…
## $ season &lt;int&gt; 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 &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;int&gt; 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 &lt;fct&gt; 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 &lt;chr&gt; "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "20…
## $ sea_description &lt;chr&gt; "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "…
## $ mmwrid &lt;int&gt; 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2…</code></pre>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1"><span class="kw">ggplot</span>(fs_nat, <span class="kw">aes</span>(wk_end, rate)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw">geom_line</span>(<span class="kw">aes</span>(<span class="dt">color=</span>age_label, <span class="dt">group=</span>age_label)) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-3" data-line-number="3"><span class="st"> </span><span class="kw">facet_wrap</span>(<span class="op">~</span>sea_description, <span class="dt">scales=</span><span class="st">"free_x"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/scale_ipsum">scale_color_ipsum</a></span>(<span class="dt">name=</span><span class="ot">NULL</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-5" data-line-number="5"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="st">"Rates per 100,000 population"</span>,</a>
<a class="sourceLine" id="cb18-6" data-line-number="6"> <span class="dt">title=</span><span class="st">"FluSurv-NET :: Entire Network :: All Seasons :: Cumulative Rate"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>()</a></code></pre></div>
<p><img src="index_files/figure-html/surveillance-areas-1.png" width="960"></p>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/hospitalizations.html">hospitalizations</a></span>(<span class="st">"eip"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## Observations: 180
## Variables: 14
## $ surveillance_area &lt;chr&gt; "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", …
## $ region &lt;chr&gt; "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year &lt;int&gt; 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
## $ season &lt;int&gt; 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 &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;int&gt; 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 &lt;fct&gt; 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 &lt;chr&gt; "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description &lt;chr&gt; "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid &lt;int&gt; 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…</code></pre>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/hospitalizations.html">hospitalizations</a></span>(<span class="st">"eip"</span>, <span class="st">"Colorado"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## Observations: 180
## Variables: 14
## $ surveillance_area &lt;chr&gt; "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", …
## $ region &lt;chr&gt; "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colora…
## $ year &lt;int&gt; 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
## $ season &lt;int&gt; 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 &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;int&gt; 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 &lt;fct&gt; 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 &lt;chr&gt; "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description &lt;chr&gt; "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid &lt;int&gt; 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…</code></pre>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/hospitalizations.html">hospitalizations</a></span>(<span class="st">"ihsp"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## Observations: 180
## Variables: 14
## $ surveillance_area &lt;chr&gt; "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH…
## $ region &lt;chr&gt; "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "…
## $ year &lt;int&gt; 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2…
## $ season &lt;int&gt; 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 &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;int&gt; 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 &lt;fct&gt; 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 &lt;chr&gt; "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20…
## $ sea_description &lt;chr&gt; "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "…
## $ mmwrid &lt;int&gt; 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2…</code></pre>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1"><span class="kw">glimpse</span>(<span class="kw"><a href="reference/hospitalizations.html">hospitalizations</a></span>(<span class="st">"ihsp"</span>, <span class="st">"Oklahoma"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## Observations: 180
## Variables: 14
## $ surveillance_area &lt;chr&gt; "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH…
## $ region &lt;chr&gt; "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklaho…
## $ year &lt;int&gt; 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011, 2…
## $ season &lt;int&gt; 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 &lt;date&gt; 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 &lt;date&gt; 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 &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;int&gt; 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 &lt;fct&gt; 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 &lt;chr&gt; "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "20…
## $ sea_description &lt;chr&gt; "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "…
## $ mmwrid &lt;int&gt; 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2…</code></pre>
</div>
<div id="retrieve-ilinet-surveillance-data" class="section level3">
<h3 class="hasAnchor">
<a href="#retrieve-ilinet-surveillance-data" class="anchor"></a>Retrieve ILINet Surveillance Data</h3>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1"><span class="kw">walk</span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"national"</span>, <span class="st">"hhs"</span>, <span class="st">"census"</span>, <span class="st">"state"</span>), <span class="op">~</span>{</a>
<a class="sourceLine" id="cb27-2" data-line-number="2"> </a>
<a class="sourceLine" id="cb27-3" data-line-number="3"> ili_df &lt;-<span class="st"> </span><span class="kw"><a href="reference/ilinet.html">ilinet</a></span>(<span class="dt">region =</span> .x)</a>
<a class="sourceLine" id="cb27-4" data-line-number="4"> </a>
<a class="sourceLine" id="cb27-5" data-line-number="5"> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(<span class="kw">glimpse</span>(ili_df))</a>
<a class="sourceLine" id="cb27-6" data-line-number="6"> </a>
<a class="sourceLine" id="cb27-7" data-line-number="7"> <span class="kw">ggplot</span>(ili_df, <span class="kw">aes</span>(week_start, unweighted_ili, <span class="dt">group=</span>region, <span class="dt">color=</span>region)) <span class="op">+</span></a>
<a class="sourceLine" id="cb27-8" data-line-number="8"><span class="st"> </span><span class="kw">geom_line</span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb27-9" data-line-number="9"><span class="st"> </span>viridis<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/viridis/topics/scale_viridis">scale_color_viridis</a></span>(<span class="dt">discrete=</span><span class="ot">TRUE</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb27-10" data-line-number="10"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="st">"Unweighted ILI"</span>, <span class="dt">title=</span>ili_df<span class="op">$</span>region_type[<span class="dv">1</span>]) <span class="op">+</span></a>
<a class="sourceLine" id="cb27-11" data-line-number="11"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>(<span class="dt">grid=</span><span class="st">"XY"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb27-12" data-line-number="12"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"none"</span>) -&gt;<span class="st"> </span>gg</a>
<a class="sourceLine" id="cb27-13" data-line-number="13"> </a>
<a class="sourceLine" id="cb27-14" data-line-number="14"> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(gg)</a>
<a class="sourceLine" id="cb27-15" data-line-number="15"> </a>
<a class="sourceLine" id="cb27-16" data-line-number="16">})</a></code></pre></div>
<pre><code>## Observations: 1,111
## Variables: 16
## $ region_type &lt;chr&gt; "National", "National", "National", "National", "National", "National", "National", "Nationa…
## $ region &lt;chr&gt; "National", "National", "National", "National", "National", "National", "National", "Nationa…
## $ year &lt;int&gt; 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, 19…
## $ week &lt;int&gt; 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 &lt;dbl&gt; 1.101480, 1.200070, 1.378760, 1.199200, 1.656180, 1.413260, 1.986800, 2.447490, 1.739010, 1.…
## $ unweighted_ili &lt;dbl&gt; 1.216860, 1.280640, 1.239060, 1.144730, 1.261120, 1.282750, 1.445790, 1.647960, 1.675170, 1.…
## $ age_0_4 &lt;dbl&gt; 179, 199, 228, 188, 217, 178, 294, 288, 268, 299, 346, 348, 510, 579, 639, 690, 856, 824, 88…
## $ age_25_49 &lt;dbl&gt; 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 &lt;dbl&gt; 157, 151, 153, 193, 162, 148, 240, 293, 206, 282, 268, 235, 404, 584, 759, 654, 679, 817, 76…
## $ age_5_24 &lt;dbl&gt; 205, 242, 266, 236, 280, 281, 328, 456, 343, 415, 388, 362, 492, 576, 810, 1121, 1440, 1600,…
## $ age_50_64 &lt;dbl&gt; 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 &lt;dbl&gt; 29, 23, 34, 36, 41, 48, 70, 63, 69, 102, 81, 59, 113, 207, 207, 148, 151, 196, 233, 146, 119…
## $ ilitotal &lt;dbl&gt; 570, 615, 681, 653, 700, 655, 932, 1100, 886, 1098, 1083, 1004, 1519, 1946, 2415, 2613, 3126…
## $ num_of_providers &lt;dbl&gt; 192, 191, 219, 213, 213, 195, 248, 256, 252, 253, 242, 190, 251, 250, 254, 255, 245, 245, 23…
## $ total_patients &lt;dbl&gt; 46842, 48023, 54961, 57044, 55506, 51062, 64463, 66749, 52890, 67887, 61314, 47719, 48429, 5…
## $ week_start &lt;date&gt; 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
## &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;dbl&gt;, num_of_providers &lt;dbl&gt;, total_patients &lt;dbl&gt;,
## # week_start &lt;date&gt;</code></pre>
<p><img src="index_files/figure-html/ili-df-1.png" width="700"></p>
<pre><code>## Observations: 11,110
## Variables: 16
## $ region_type &lt;chr&gt; "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "H…
## $ region &lt;fct&gt; Region 1, Region 2, Region 3, Region 4, Region 5, Region 6, Region 7, Region 8, Region 9, Re…
## $ year &lt;int&gt; 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19…
## $ week &lt;int&gt; 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 &lt;dbl&gt; 0.498535, 0.374963, 1.354280, 0.400338, 1.229260, 1.018980, 0.871791, 0.516017, 1.807610, 4.…
## $ unweighted_ili &lt;dbl&gt; 0.623848, 0.384615, 1.341720, 0.450010, 0.901266, 0.747384, 1.152860, 0.422654, 2.258780, 4.…
## $ age_0_4 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 7053, 780, 2385, 10222, 9875, 669, 2342, 1183, 10758, 1575, 6987, 872, 2740, 11310, 9618, 68…
## $ week_start &lt;date&gt; 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
## &lt;chr&gt; &lt;fct&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;dbl&gt;, num_of_providers &lt;dbl&gt;, total_patients &lt;dbl&gt;,
## # week_start &lt;date&gt;</code></pre>
<p><img src="index_files/figure-html/ili-df-2.png" width="700"></p>
<pre><code>## Observations: 9,999
## Variables: 16
## $ region_type &lt;chr&gt; "Census Regions", "Census Regions", "Census Regions", "Census Regions", "Census Regions", "C…
## $ region &lt;chr&gt; "New England", "Mid-Atlantic", "East North Central", "West North Central", "South Atlantic",…
## $ year &lt;int&gt; 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19…
## $ week &lt;int&gt; 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 &lt;dbl&gt; 0.4985350, 0.8441440, 0.7924860, 1.7640500, 0.5026620, 0.0542283, 1.0189800, 2.2587800, 2.04…
## $ unweighted_ili &lt;dbl&gt; 0.6238480, 1.3213800, 0.8187380, 1.2793900, 0.7233800, 0.0688705, 0.7473840, 2.2763300, 3.23…
## $ age_0_4 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 7053, 2119, 9649, 2892, 6912, 4356, 669, 10719, 2473, 6987, 2384, 9427, 2823, 7591, 4947, 68…
## $ week_start &lt;date&gt; 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
## &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;dbl&gt;, num_of_providers &lt;dbl&gt;, total_patients &lt;dbl&gt;,
## # week_start &lt;date&gt;</code></pre>
<p><img src="index_files/figure-html/ili-df-3.png" width="700"></p>
<pre><code>## Observations: 23,120
## Variables: 16
## $ region_type &lt;chr&gt; "States", "States", "States", "States", "States", "States", "States", "States", "States", "S…
## $ region &lt;chr&gt; "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delawa…
## $ year &lt;int&gt; 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 20…
## $ week &lt;int&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 2.1347700, 0.8751460, 0.6747210, 0.6960560, 1.9541200, 0.6606840, 0.0783085, 0.1001250, 2.80…
## $ age_0_4 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ ilitotal &lt;dbl&gt; 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 &lt;dbl&gt; 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 &lt;dbl&gt; 11664, 1714, 25492, 2586, 32342, 20282, 3831, 3995, 2599, NA, 40314, 1943, 4579, 39390, 1252…
## $ week_start &lt;date&gt; 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
## &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;dbl&gt;, num_of_providers &lt;dbl&gt;, total_patients &lt;dbl&gt;,
## # week_start &lt;date&gt;</code></pre>
<p><img src="index_files/figure-html/ili-df-4.png" width="700"></p>
</div>
<div id="retrieve-weekly-state-level-ili-indicators-per-state-for-a-given-season" class="section level3">
<h3 class="hasAnchor">
<a href="#retrieve-weekly-state-level-ili-indicators-per-state-for-a-given-season" class="anchor"></a>Retrieve weekly state-level ILI indicators per-state for a given season</h3>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb32-1" data-line-number="1"><span class="kw"><a href="reference/ili_weekly_activity_indicators.html">ili_weekly_activity_indicators</a></span>(<span class="dv">2017</span>)</a></code></pre></div>
<pre><code>## # A tibble: 2,805 x 8
## statename url website activity_level activity_level_l… weekend season weeknumber
## * &lt;chr&gt; &lt;chr&gt; &lt;chr&gt; &lt;dbl&gt; &lt;chr&gt; &lt;date&gt; &lt;chr&gt; &lt;dbl&gt;
## 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 &amp; 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</code></pre>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb34-1" data-line-number="1">xdf &lt;-<span class="st"> </span><span class="kw">map_df</span>(<span class="dv">2008</span><span class="op">:</span><span class="dv">2017</span>, ili_weekly_activity_indicators)</a>
<a class="sourceLine" id="cb34-2" data-line-number="2"></a>
<a class="sourceLine" id="cb34-3" data-line-number="3"><span class="kw">count</span>(xdf, weekend, activity_level_label) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb34-4" data-line-number="4"><span class="st"> </span><span class="kw">complete</span>(weekend, activity_level_label) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb34-5" data-line-number="5"><span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(weekend, activity_level_label, <span class="dt">fill=</span>n)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb34-6" data-line-number="6"><span class="st"> </span><span class="kw">geom_tile</span>(<span class="dt">color=</span><span class="st">"#c2c2c2"</span>, <span class="dt">size=</span><span class="fl">0.1</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-7" data-line-number="7"><span class="st"> </span><span class="kw">scale_x_date</span>(<span class="dt">expand=</span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-8" data-line-number="8"><span class="st"> </span>viridis<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/viridis/topics/scale_viridis">scale_fill_viridis</a></span>(<span class="dt">name=</span><span class="st">"# States"</span>, <span class="dt">na.value=</span><span class="st">"White"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-9" data-line-number="9"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"Weekly ILI Indicators (all states)"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-10" data-line-number="10"><span class="st"> </span><span class="kw">coord_fixed</span>(<span class="dv">100</span><span class="op">/</span><span class="dv">1</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-11" data-line-number="11"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>(<span class="dt">grid=</span><span class="st">""</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb34-12" data-line-number="12"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position=</span><span class="st">"bottom"</span>)</a></code></pre></div>
<p><img src="index_files/figure-html/ili-weekly-activity-1.png" width="960"></p>
</div>
<div id="pneumonia-and-influenza-mortality-surveillance" class="section level3">
<h3 class="hasAnchor">
<a href="#pneumonia-and-influenza-mortality-surveillance" class="anchor"></a>Pneumonia and Influenza Mortality Surveillance</h3>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb35-1" data-line-number="1">(nat_pi &lt;-<span class="st"> </span><span class="kw"><a href="reference/pi_mortality.html">pi_mortality</a></span>(<span class="st">"national"</span>))</a></code></pre></div>
<pre><code>## # A tibble: 483 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;chr&gt;, geo_description &lt;chr&gt;, age_label &lt;chr&gt;,
## # wk_start &lt;date&gt;, wk_end &lt;date&gt;, year_wk_num &lt;int&gt;, mmwrid &lt;chr&gt;, coverage_area &lt;chr&gt;, region_name &lt;chr&gt;,
## # callout &lt;chr&gt;</code></pre>
<div class="sourceCode" id="cb37"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb37-1" data-line-number="1"><span class="kw">select</span>(nat_pi, wk_end, percent_pni, baseline, threshold) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb37-2" data-line-number="2"><span class="st"> </span><span class="kw">gather</span>(measure, value, <span class="op">-</span>wk_end) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb37-3" data-line-number="3"><span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(wk_end, value)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb37-4" data-line-number="4"><span class="st"> </span><span class="kw">geom_line</span>(<span class="kw">aes</span>(<span class="dt">group=</span>measure, <span class="dt">color=</span>measure)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb37-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/scale_x_percent">scale_y_percent</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb37-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/scale_ipsum">scale_color_ipsum</a></span>(<span class="dt">name =</span> <span class="ot">NULL</span>, <span class="dt">labels=</span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Baseline"</span>, <span class="st">"Percent P&amp;I"</span>, <span class="st">"Threshold"</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb37-7" data-line-number="7"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="st">"% of all deaths due to P&amp;I"</span>,</a>
<a class="sourceLine" id="cb37-8" data-line-number="8"> <span class="dt">title=</span><span class="st">"Percentage of all deaths due to pneumonia and influenza, National Summary"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb37-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>(<span class="dt">grid=</span><span class="st">"XY"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb37-10" data-line-number="10"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position=</span><span class="st">"bottom"</span>)</a></code></pre></div>
<p><img src="index_files/figure-html/nat-pi-mortality-1.png" width="700"></p>
<div class="sourceCode" id="cb38"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb38-1" data-line-number="1">(st_pi &lt;-<span class="st"> </span><span class="kw"><a href="reference/pi_mortality.html">pi_mortality</a></span>(<span class="st">"state"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## # A tibble: 2,704 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;chr&gt;, geo_description &lt;chr&gt;, age_label &lt;chr&gt;,
## # wk_start &lt;date&gt;, wk_end &lt;date&gt;, year_wk_num &lt;int&gt;, mmwrid &lt;chr&gt;, coverage_area &lt;chr&gt;, region_name &lt;chr&gt;,
## # callout &lt;chr&gt;</code></pre>
<div class="sourceCode" id="cb40"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb40-1" data-line-number="1">(reg_pi &lt;-<span class="st"> </span><span class="kw"><a href="reference/pi_mortality.html">pi_mortality</a></span>(<span class="st">"region"</span>, <span class="dt">years=</span><span class="dv">2015</span>))</a></code></pre></div>
<pre><code>## # A tibble: 520 x 19
## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni
## &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 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 &lt;chr&gt;, geo_description &lt;chr&gt;, age_label &lt;chr&gt;,
## # wk_start &lt;date&gt;, wk_end &lt;date&gt;, year_wk_num &lt;int&gt;, mmwrid &lt;chr&gt;, coverage_area &lt;chr&gt;, region_name &lt;chr&gt;,
## # callout &lt;chr&gt;</code></pre>
</div>
<div id="retrieve-metadata-about-u-s--state-cdc-provider-data" class="section level3">
<h3 class="hasAnchor">
<a href="#retrieve-metadata-about-u-s--state-cdc-provider-data" class="anchor"></a>Retrieve metadata about U.S. State CDC Provider Data</h3>
<div class="sourceCode" id="cb42"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb42-1" data-line-number="1"><span class="kw"><a href="reference/state_data_providers.html">state_data_providers</a></span>()</a></code></pre></div>
<pre><code>## # A tibble: 59 x 5
## statename statehealthdeptname url statewebsitename statefluphonenum
## * &lt;chr&gt; &lt;chr&gt; &lt;chr&gt; &lt;chr&gt; &lt;chr&gt;
## 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 &amp; 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</code></pre>
</div>
<div id="retrieve-whonrevss-surveillance-data" class="section level3">
<h3 class="hasAnchor">
<a href="#retrieve-whonrevss-surveillance-data" class="anchor"></a>Retrieve WHO/NREVSS Surveillance Data</h3>
<div class="sourceCode" id="cb44"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb44-1" data-line-number="1"><span class="kw">glimpse</span>(xdat &lt;-<span class="st"> </span><span class="kw"><a href="reference/who_nrevss.html">who_nrevss</a></span>(<span class="st">"national"</span>))</a></code></pre></div>
<pre><code>## 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" ...</code></pre>
<div class="sourceCode" id="cb46"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb46-1" data-line-number="1"><span class="kw">mutate</span>(xdat<span class="op">$</span>combined_prior_to_<span class="dv">2015</span>_<span class="dv">16</span>, </a>
<a class="sourceLine" id="cb46-2" data-line-number="2"> <span class="dt">percent_positive =</span> percent_positive <span class="op">/</span><span class="st"> </span><span class="dv">100</span>) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb46-3" data-line-number="3"><span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(wk_date, percent_positive)) <span class="op">+</span></a>
<a class="sourceLine" id="cb46-4" data-line-number="4"><span class="st"> </span><span class="kw">geom_line</span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb46-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/scale_x_percent">scale_y_percent</a></span>(<span class="dt">name=</span><span class="st">"% Positive"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb46-6" data-line-number="6"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"WHO/NREVSS Surveillance Data (National)"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb46-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>(<span class="dt">grid=</span><span class="st">"XY"</span>)</a></code></pre></div>
<p><img src="index_files/figure-html/who-vrevss-1.png" width="700"></p>
<div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb47-1" data-line-number="1"><span class="kw"><a href="reference/who_nrevss.html">who_nrevss</a></span>(<span class="st">"hhs"</span>, <span class="dt">years=</span><span class="dv">2016</span>)</a></code></pre></div>
<pre><code>## $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
## &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;date&gt;
## 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
## &lt;chr