diff --git a/.Rbuildignore b/.Rbuildignore index 2f0e197..b62dabd 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,9 +10,6 @@ ^doc$ ^CONDUCT\.md$ ^codecov\.yml$ -^.*\.Rproj$ -^\.Rproj\.user$ -^\.travis\.yml$ ^.*md$ ^crunch ^crunch/ @@ -21,7 +18,6 @@ ^README_files/.* ^README-.* ^cran-comments\.md$ -^codecov\.yml$ ^Makefile$ ^README.gfm-ascii_identifiers_files ^README.gfm-ascii_identifiers_files/ diff --git a/DESCRIPTION b/DESCRIPTION index e6b56f4..f08e2b6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,22 +1,22 @@ Package: cdcfluview Type: Package Encoding: UTF-8 -Title: Retrieve 'U.S'.' Flu Season Data from the 'CDC' 'FluView' Portal +Title: Retrieve 'U.S'. Flu Season Data from the 'CDC' 'FluView' Portal Version: 0.7.0 Date: 2017-11-04 Authors@R: c( person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5670-2640")), - person("Craig", "McGowan", email = "mcgowan.cj@gmail.com", role = "ctb") + person("Craig", "McGowan", email = "mcgowan.cj@gmail.com", role = "ctb", + comment = c(ORCID = "0000-0002-6298-0185")) ) -Author: Bob Rudis (bob@rud.is) Maintainer: Bob Rudis -Description: The U.S. Centers for Disease Control (CDC) maintains a portal +Description: The 'U.S.' Centers for Disease Control ('CDC') maintains a portal 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. + 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'. URL: https://github.com/hrbrmstr/cdcfluview BugReports: https://github.com/hrbrmstr/cdcfluview/issues License: MIT + file LICENSE diff --git a/NEWS.md b/NEWS.md index 31d74ff..677a3a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,13 @@ # cdcfluview 0.7.0 -* The CDC changed most of their API endpoints to support a new HTML interface. - There are many breaking changes but also many new data endpoints. +* 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 diff --git a/R/zzz.r b/R/zzz.r index 8d2e947..861dd5a 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -1,11 +1,14 @@ -# this is only used during active development phases before/after CRAN releases - .onAttach <- function(...) { # nocov start if (!interactive()) return() - packageStartupMessage(paste0("cdcfluview is under *active* development. ", - "There are numerous changes & dprecations.\n", - "See https://github.com/hrbrmstr/cdcfluview for info/news.")) + if (sample(c(TRUE, FALSE), 1, prob = c(0.1, 0.9))) { + packageStartupMessage(paste0("There are numerous changes & deprecations. ", + "See https://github.com/hrbrmstr/cdcfluview for info/news.")) + } + + # packageStartupMessage(paste0("cdcfluview is under *active* development. ", + # "There are numerous changes & dprecations.\n", + # "See https://github.com/hrbrmstr/cdcfluview for info/news.")) } # nocov end diff --git a/README.Rmd b/README.Rmd index e8d3ed1..c8e50cf 100644 --- a/README.Rmd +++ b/README.Rmd @@ -3,7 +3,10 @@ title: "" pagetitle: "" output: rmarkdown::github_document --- - +```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} +knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.retina=2) +options(width=120) +``` [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/cdcfluview)](https://cran.r-project.org/package=cdcfluview) [![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/cdcfluview.svg?branch=master)](https://travis-ci.org/hrbrmstr/cdcfluview) [![Coverage Status](https://img.shields.io/codecov/c/github/hrbrmstr/cdcfluview/master.svg)](https://codecov.io/github/hrbrmstr/cdcfluview?branch=master) @@ -67,13 +70,9 @@ The following data sets are included: devtools::install_github("hrbrmstr/cdcfluview") ``` -```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} -options(width=120) -``` - ## Usage -```{r message=FALSE, warning=FALSE, error=FALSE} +```{r} library(cdcfluview) library(hrbrthemes) library(tidyverse) @@ -84,13 +83,13 @@ packageVersion("cdcfluview") ### Age Group Distribution of Influenza Positive Tests Reported by Public Health Laboratories -```{r message=FALSE, warning=FALSE} +```{r} glimpse(age_group_distribution(years=2015)) ``` ### Retrieve CDC U.S. Coverage Map -```{r message=FALSE, warning=FALSE} +```{r} plot(cdc_basemap("national")) plot(cdc_basemap("hhs")) plot(cdc_basemap("census")) @@ -107,7 +106,7 @@ glimpse(geographic_spread()) ### Laboratory-Confirmed Influenza Hospitalizations -```{r message=FALSE, warning=FALSE, fig.width=10, fig.height=7.5} +```{r fig.width=10, fig.height=7.5} surveillance_areas() glimpse(fs_nat <- hospitalizations("flusurv")) @@ -131,7 +130,7 @@ glimpse(hospitalizations("ihsp", "Oklahoma", years=2015)) ### Retrieve ILINet Surveillance Data -```{r message=FALSE, warning=FALSE} +```{r} walk(c("national", "hhs", "census", "state"), ~{ ili_df <- ilinet(region = .x) @@ -152,7 +151,7 @@ walk(c("national", "hhs", "census", "state"), ~{ ### Retrieve weekly state-level ILI indicators per-state for a given season -```{r message=FALSE, warning=FALSE, fig.width=10, fig.height=5} +```{r fig.width=10, fig.height=5} ili_weekly_activity_indicators(2017) xdf <- map_df(2008:2017, ili_weekly_activity_indicators) @@ -171,7 +170,7 @@ count(xdf, weekend, activity_level_label) %>% ### Pneumonia and Influenza Mortality Surveillance -```{r message=FALSE, warning=FALSE} +```{r} (nat_pi <- pi_mortality("national")) select(nat_pi, wk_end, percent_pni, baseline, threshold) %>% @@ -192,13 +191,13 @@ select(nat_pi, wk_end, percent_pni, baseline, threshold) %>% ### Retrieve metadata about U.S. State CDC Provider Data -```{r message=FALSE, warning=FALSE} +```{r} state_data_providers() ``` ### Retrieve WHO/NREVSS Surveillance Data -```{r message=FALSE, warning=FALSE} +```{r} glimpse(xdat <- who_nrevss("national")) mutate(xdat$combined_prior_to_2015_16, @@ -216,7 +215,6 @@ who_nrevss("census", years=2016) who_nrevss("state", years=2016) ``` - ## Code of Conduct Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. \ No newline at end of file diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png index 1a61eea..0d9da2b 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png index 756866e..83a7e3d 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-1.png index 5f5a7d4..9d6b0b3 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-1.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-2.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-2.png index a34ab31..843f862 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-2.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-2.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-3.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-3.png index 3956115..10fc9ef 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-3.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-3.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-4.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-4.png index 45b52b0..482c8bc 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-4.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-4.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-5.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-5.png index 35c0f1a..929679c 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-5.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-5.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-6.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-6.png index 2c7db1d..736cf6d 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-6.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-6.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-7-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-7-1.png index 117021e..0c9233f 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-7-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-7-1.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-1.png index c26438d..1abfc60 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-1.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-2.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-2.png index be0d801..99310a0 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-2.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-2.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-3.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-3.png index 87c1333..ccb17b0 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-3.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-3.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-4.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-4.png index 0def25b..1b0f116 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-4.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-4.png differ diff --git a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-9-1.png b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-9-1.png index a29fa33..99147a5 100644 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-9-1.png and b/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-9-1.png differ diff --git a/cran-comments.md b/cran-comments.md index 587fbab..9c3f83a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,18 +1,34 @@ ## Test environments -* local OS X install, R 3.3.2 & R-devel -* ubuntu 12.04 (on travis-ci), R 3.3.2, R-oldrel and R-devel + +* local OS X install, R 3.4.2 +* local Ubuntu 16.04 R 3.4.1 +* ubuntu 14.04 (on travis-ci), R old/current/devel * win-builder (devel and release) +* rhub Windows (devel and release) ## R CMD check results -0 errors | 0 warnings | 0 notes +0 errors | 0 warnings | 1 note ---- +* This is a maintenance update. -This is a bug-fix release. +## Reverse dependencies -The CDC changed over to using https URLs which broke the core function. +None + +--- -Their state API also changed from returning a CSV file to a JSON direct response. +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. -Tests have been added as well. \ No newline at end of file +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% +code coverage during tests . +All package functions are also evaluated on each new generation of the README. \ No newline at end of file