diff --git a/.travis.yml b/.travis.yml index 82b1af4..8dfc82e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,21 @@ -language: r - -sudo: required - +language: R cache: packages - +sudo: true dist: trusty -before_install: - - sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes - - sudo apt-get --yes --force-yes update -qq - # install tmap dependencies - - sudo apt-get install --yes libprotobuf-dev protobuf-compiler libv8-3.14-dev - # install tmap dependencies; for 16.04 libjq-dev this ppa is needed: - - sudo add-apt-repository -y ppa:opencpu/jq - - sudo apt-get --yes --force-yes update -qq - - sudo apt-get install libjq-dev - # units/udunits2 dependency: - - sudo apt-get install --yes libudunits2-dev - # sf dependencies: - - sudo apt-get install --yes libproj-dev libgeos-dev libgdal-dev - # postgis source compile dependencies: - - sudo apt-get --yes install libjson-c-dev postgresql-server-dev-9.6 - # install postgis from source: - - wget http://download.osgeo.org/postgis/source/postgis-2.3.2.tar.gz - - (mv postgis* /tmp; cd /tmp; tar xzf postgis-2.3.2.tar.gz) - - (cd /tmp/postgis-2.3.2 ; ./configure; make; sudo make install) - # activate liblwgeom by: - - sudo ldconfig - # create postgis databases: - - sudo service postgresql restart - - createdb postgis - - psql -d postgis -c "CREATE EXTENSION postgis;" - - psql -d postgis -c "GRANT CREATE ON DATABASE postgis TO travis" - - createdb empty - - psql -d empty -c "CREATE EXTENSION postgis;" - - -addons: - postgresql: "9.6" - -r: - - oldrel - - release - - devel +# environment variables set for all builds +env: + global: + # don't treat missing suggested packages as error + - _R_CHECK_FORCE_SUGGESTS_=false + # switch off vdiffr by default + - VDIFFR_RUN_TESTS=false after_success: - - dropdb postgis - - createdb postgis - - psql -d postgis -c "CREATE EXTENSION postgis;" - - psql -d postgis -c "GRANT CREATE ON DATABASE postgis TO travis" - Rscript -e 'covr::codecov()' + +before_install: + - sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes + - sudo apt-get --yes --force-yes update -qq + - sudo apt-get install --yes libudunits2-dev libproj-dev libgeos-dev libgdal-dev + - Rscript -e 'update.packages(ask = FALSE)' \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index efcbcad..cd4d029 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,10 @@ Package: cdcfluview Type: Package Encoding: UTF-8 -Title: Retrieve U.S. Flu Season Data from the CDC 'FluView' Portal -Version: 0.8.0 -Date: 2018-11-23 +Title: Retrieve Flu Season Data from the United States Centers for Disease Control + and Prevention ('CDC') 'FluView' Portal +Version: 0.9.0 +Date: 2019-01-23 Authors@R: c( person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5670-2640")), @@ -12,17 +13,19 @@ Authors@R: c( person("JJ", "Chen", email = "jiajia.chern@gmail.com", role = "ctb", comment = c(ORCID = "0000-0001-8482-8398")), person("Sebastian", "Meyer", email = "seb.meyer@fau.de", role = "ctb", - comment = c(ORCID = "0000-0002-1791-9449")) + comment = c(ORCID = "0000-0002-1791-9449")), + person("James", "Turtle", email = "jturtle@predsci.com", role = "ctb", + comment = c(ORCID = "0000-0003-0735-7769")) ) Maintainer: Bob Rudis -Description: The U.S. Centers for Disease Control and Prevention (CDC) maintain +Description: The 'U.S.' Centers for Disease Control and Prevention (CDC) maintain a portal 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. -URL: https://github.com/hrbrmstr/cdcfluview -BugReports: https://github.com/hrbrmstr/cdcfluview/issues + to access the data provided by the portal's underlying 'API'. +URL: https://gitlab.com/hrbrmstr/cdcfluview +BugReports: https://gitlab.com/hrbrmstr/cdcfluview/issues License: MIT + file LICENSE LazyData: true Suggests: @@ -43,4 +46,4 @@ Imports: readr, MMWRweek, units (>= 0.4-6) -RoxygenNote: 6.0.1.9000 +RoxygenNote: 6.1.1 diff --git a/NAMESPACE b/NAMESPACE index 1754940..142241e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,6 +22,7 @@ import(MMWRweek) import(httr) import(xml2) importFrom(dplyr,"%>%") +importFrom(dplyr,arrange) importFrom(dplyr,bind_rows) importFrom(dplyr,data_frame) importFrom(dplyr,filter) diff --git a/NEWS.md b/NEWS.md index 677a3a1..6cd187b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# cdcfluview 0.9.0 + +- fix bug in epiweek computation in ilinet() thanks to a bug report by @jturtle (#19) +- included cloc metrics and refreshed README +- + # cdcfluview 0.7.0 * The CDC changed most of their API endpoints to support a new HTML interface and diff --git a/R/aaa.R b/R/aaa.R index 48010c1..9869882 100644 --- a/R/aaa.R +++ b/R/aaa.R @@ -1,4 +1,4 @@ -utils::globalVariables(c(".", "mmwrid", "season", "seasonid")) +utils::globalVariables(c(".", "mmwrid", "season", "seasonid", "week_start")) # CDC U.S. region names to ID map .region_map <- c(national=3, hhs=1, census=2, state=5) diff --git a/R/agd-ipt.r b/R/agd-ipt.r index c54322f..c8c3e00 100644 --- a/R/agd-ipt.r +++ b/R/agd-ipt.r @@ -16,7 +16,7 @@ #' to a year. #' @export #' @examples -#' age_group_distribution(years=2015) +#' agd <- age_group_distribution(years=2015) age_group_distribution <- function(years = NULL) { httr::GET( diff --git a/R/cdcfluview-package.R b/R/cdcfluview-package.R index 07429e9..bf73efc 100644 --- a/R/cdcfluview-package.R +++ b/R/cdcfluview-package.R @@ -1,4 +1,4 @@ -#' Retrieve 'U.S'.' Flu Season Data from the 'CDC' 'FluView' Portal +#' Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal #' #' The U.S. Centers for Disease Control (CDC) maintains a portal #' for @@ -17,7 +17,7 @@ #' @importFrom purrr map map_df map_chr map_lgl discard keep #' @importFrom readr read_csv type_convert #' @importFrom tools file_path_sans_ext -#' @importFrom dplyr left_join bind_rows mutate filter data_frame %>% +#' @importFrom dplyr left_join bind_rows mutate filter data_frame %>% arrange #' @importFrom jsonlite fromJSON #' @importFrom stats setNames #' @importFrom sf st_read diff --git a/R/geographic-spread.R b/R/geographic-spread.R index 88afd72..b23d351 100644 --- a/R/geographic-spread.R +++ b/R/geographic-spread.R @@ -10,7 +10,7 @@ #' to a year. #' @export #' @examples \dontrun{ -#' geographic_spread() +#' gs <- geographic_spread() #' } geographic_spread <- function(years=NULL) { @@ -57,7 +57,7 @@ geographic_spread <- function(years=NULL) { res <- httr::content(res, as="parsed", flatten=TRUE) - xdf <- dplyr::bind_rows(res$datadownload) + suppressMessages(suppressWarnings(xdf <- dplyr::bind_rows(res$datadownload))) xdf$weekend <- as.Date(xdf$weekend, format="%B-%d-%Y") xdf diff --git a/R/get-flu-data.r b/R/get-flu-data.r index acccdb9..1ed8d0e 100644 --- a/R/get-flu-data.r +++ b/R/get-flu-data.r @@ -30,9 +30,6 @@ #' servers to crunch the data. Wrap the function call in \code{httr::with_verbose} #' if you would like to see what's going on. #' @export -#' @examples \dontrun{ -#' flu <- get_flu_data("hhs", 1:10, c("who", "ilinet"), years=2000:2014) -#' } get_flu_data <- function(region="hhs", sub_region=1:10, data_source="ilinet", years=as.numeric(format(Sys.Date(), "%Y"))) { diff --git a/R/get-hosp-data.r b/R/get-hosp-data.r index f27af0a..158b4fd 100644 --- a/R/get-hosp-data.r +++ b/R/get-hosp-data.r @@ -22,7 +22,7 @@ #' @export #' @examples \dontrun{ #' # All of FluSurv-NET, 50-64 years old, 2010/11-2014/15 flu seasons -#' flu <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014) +#' hosp <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014) #' } get_hosp_data <- function(area="flusurvnet", age_group="overall", years=as.numeric(format(Sys.Date(), "%Y")) - 1) { diff --git a/R/get-state-data.r b/R/get-state-data.r index 424535b..2f6b764 100644 --- a/R/get-state-data.r +++ b/R/get-state-data.r @@ -18,12 +18,11 @@ #' is not due to a large download size, but the time it takes for their #' servers to crunch the data. Wrap the function call in \code{httr::with_verbose} #' if you would like to see what's going on. -#' @examples -#' get_state_data(2014) +#' @examples +#' state_data <- get_state_data(2014) #' \dontrun{ -#' get_state_data(c(2013, 2014)) -#' get_state_data(2010:2014) -#' httr::with_verbose(get_state_data(2009:2015)) +#' gsd <- get_state_data(c(2013, 2014)) +#' gsd <- get_state_data(2010:2014) #' } get_state_data <- function(years=as.numeric(format(Sys.Date(), "%Y"))) { diff --git a/R/get-weekly-flu-report.r b/R/get-weekly-flu-report.r index 006fb03..db79642 100644 --- a/R/get-weekly-flu-report.r +++ b/R/get-weekly-flu-report.r @@ -15,7 +15,7 @@ #' \code{label}, \code{subtitle} #' @export #' @examples \dontrun{ -#' get_weekly_flu_report() +#' wfr <- get_weekly_flu_report() #' } get_weekly_flu_report <- function() { @@ -28,6 +28,8 @@ get_weekly_flu_report <- function() { # for each period extract the state information and # shove it all into a data frame pb <- dplyr::progress_estimated(length(periods)) + + suppressWarnings(suppressMessages( purrr::map_df(periods, function(period) { pb$tick()$print() @@ -51,7 +53,7 @@ get_weekly_flu_report <- function() { subtitle = period["subtitle"] ) - }) -> out + }) -> out)) class(out) <- c("cdcweeklyreport", class(out)) diff --git a/R/hospital.r b/R/hospital.r index a935527..3cb1128 100644 --- a/R/hospital.r +++ b/R/hospital.r @@ -16,7 +16,7 @@ #' @references #' - [Hospital Portal](https://gis.cdc.gov/GRASP/Fluview/FluHospRates.html) #' @export -#' @examples +#' @examples #' hosp_fs <- hospitalizations("flusurv", years=2015) #' \dontrun{ #' hosp_eip <- hospitalizations("eip") @@ -76,16 +76,17 @@ hospitalizations <- function(surveillance_area=c("flusurv", "eip", "ihsp"), ser_names <- unlist(hosp$res$busdata$datafields, use.names = FALSE) - mmwr_df <- bind_rows(hosp$res$mmwr) + suppressWarnings(suppressMessages(mmwr_df <- dplyr::bind_rows(hosp$res$mmwr))) mmwr_df <- mmwr_df[,c("mmwrid", "weekend", "weeknumber", "weekstart", "year", "yearweek", "seasonid", "weekendlabel", "weekendlabel2")] + suppressMessages(suppressWarnings( dplyr::bind_rows(lapply(hosp$res$busdata$dataseries, function(.x) { tdf <- dplyr::bind_rows(lapply(.x$data, function(.x) setNames(.x, ser_names))) tdf$age <- .x$age tdf$season <- .x$season tdf - })) -> xdf + })) -> xdf)) dplyr::left_join(xdf, mmwr_df, c("mmwrid", "weeknumber")) %>% dplyr::left_join(age_df, "age") %>% @@ -137,7 +138,7 @@ hospitalizations <- function(surveillance_area=c("flusurv", "eip", "ihsp"), #' @md #' @export #' @examples -#' surveillance_areas() +#' sa <- surveillance_areas() surveillance_areas <- function() { meta <- jsonlite::fromJSON("https://gis.cdc.gov/GRASP/Flu3/GetPhase03InitApp?appVersion=Public") xdf <- setNames(meta$catchments[,c("name", "area")], c("surveillance_area", "region")) diff --git a/R/ili-weekly-state.r b/R/ili-weekly-state.r index 3ec0edb..b6e757c 100644 --- a/R/ili-weekly-state.r +++ b/R/ili-weekly-state.r @@ -25,7 +25,7 @@ #' with data presented by the state likely being the more complete. #' @export #' @examples \dontrun{ -#' ili_weekly_activity_indicators(2016) +#' iwai <- ili_weekly_activity_indicators(2016) #' } ili_weekly_activity_indicators <- function(years=NULL) { @@ -78,7 +78,7 @@ ili_weekly_activity_indicators <- function(years=NULL) { #' @md #' @export #' @examples -#' state_data_providers() +#' sdp <- state_data_providers() state_data_providers <- function() { jsonlite::fromJSON("https://gis.cdc.gov/grasp/fluView1/Phase1IniP") %>% diff --git a/R/ilinet.r b/R/ilinet.r index 39797b9..1c43b24 100644 --- a/R/ilinet.r +++ b/R/ilinet.r @@ -21,19 +21,19 @@ #' - [ILINet Portal](https://wwwn.cdc.gov/ilinet/) (Login required) #' - [WHO/NREVSS](https://www.cdc.gov/surveillance/nrevss/index.html) #' @export -#' @examples -#' national_ili <- ilinet("national", years=2017) +#' @examples +#' national_ili <- ilinet("national", years = 2017) #' \dontrun{ #' hhs_ili <- ilinet("hhs") #' census_ili <- ilinet("census") #' state_ili <- ilinet("state") -#' -#' library(purrr) -#' map_df( -#' c("national", "hhs", "census", "state"), -#' ~ilinet(.x)) +#' +#' all_ili <- suppressWarnings( +#' suppressMessages(purrr::map_df(c("national", "hhs", "census", "state"), ilinet))) #' } -ilinet <- function(region=c("national", "hhs", "census", "state"), years=NULL) { +ilinet <- function(region = c("national", "hhs", "census", "state"), years = NULL) { + + #region="national"; years=1997:2018 region <- match.arg(tolower(region), c("national", "hhs", "census", "state")) @@ -46,10 +46,18 @@ ilinet <- function(region=c("national", "hhs", "census", "state"), years=NULL) { ) -> params params$SubRegionsDT <- switch(region, - national = { list(list(ID=0, Name="")) }, - hhs = { lapply(1:10, function(i) list(ID=i, Name=as.character(i))) }, - census = { lapply(1:9, function(i) list(ID=i, Name=as.character(i))) }, - state = { lapply(1:59, function(i) list(ID=i, Name=as.character(i))) } + national = { + list(list(ID = 0, Name = "")) + }, + hhs = { + lapply(1:10, function(i) list(ID = i, Name = as.character(i))) + }, + census = { + lapply(1:9, function(i) list(ID = i, Name = as.character(i))) + }, + state = { + lapply(1:59, function(i) list(ID = i, Name = as.character(i))) + } ) available_seasons <- sort(meta$seasons$seasonid) @@ -66,13 +74,14 @@ ilinet <- function(region=c("national", "hhs", "census", "state"), years=NULL) { if (length(years) == 0) { years <- rev(sort(meta$seasons$seasonid))[1] curr_season_descr <- meta$seasons[meta$seasons$seasonid == years, "description"] - message(sprintf("No valid years specified, defaulting to this flu season => ID: %s [%s]", - years, curr_season_descr)) + message(sprintf( + "No valid years specified, defaulting to this flu season => ID: %s [%s]", + years, curr_season_descr + )) } - } - params$SeasonsDT <- lapply(years, function(i) list(ID=i, Name=as.character(i))) + params$SeasonsDT <- lapply(years, function(i) list(ID = i, Name = as.character(i))) tf <- tempfile(fileext = ".zip") td <- tempdir() @@ -97,27 +106,27 @@ ilinet <- function(region=c("national", "hhs", "census", "state"), years=NULL) { nm <- unzip(tf, overwrite = TRUE, exdir = td) - xdf <- read.csv(nm, skip = 1, stringsAsFactors=FALSE) + xdf <- read.csv(nm, skip = 1, stringsAsFactors = FALSE) xdf <- .mcga(xdf) - suppressWarnings(xdf$weighted_ili <- to_num(xdf$weighted_ili)) - suppressWarnings(xdf$unweighted_ili <- to_num(xdf$unweighted_ili)) - suppressWarnings(xdf$age_0_4 <- to_num(xdf$age_0_4)) - suppressWarnings(xdf$age_25_49 <- to_num(xdf$age_25_49)) - suppressWarnings(xdf$age_25_64 <- to_num(xdf$age_25_64)) - suppressWarnings(xdf$age_5_24 <- to_num(xdf$age_5_24)) - suppressWarnings(xdf$age_50_64 <- to_num(xdf$age_50_64)) - suppressWarnings(xdf$age_65 <- to_num(xdf$age_65)) - suppressWarnings(xdf$ilitotal <- to_num(xdf$ilitotal)) - suppressWarnings(xdf$num_of_providers <- to_num(xdf$num_of_providers)) - suppressWarnings(xdf$total_patients <- to_num(xdf$total_patients)) - suppressWarnings(xdf$week_start <- as.Date(sprintf("%s-%02d-1", xdf$year, xdf$week), "%Y-%U-%u")) + xdf$weighted_ili <- to_num(xdf$weighted_ili) + xdf$unweighted_ili <- to_num(xdf$unweighted_ili) + xdf$age_0_4 <- to_num(xdf$age_0_4) + xdf$age_25_49 <- to_num(xdf$age_25_49) + xdf$age_25_64 <- to_num(xdf$age_25_64) + xdf$age_5_24 <- to_num(xdf$age_5_24) + xdf$age_50_64 <- to_num(xdf$age_50_64) + xdf$age_65 <- to_num(xdf$age_65) + xdf$ilitotal <- to_num(xdf$ilitotal) + xdf$num_of_providers <- to_num(xdf$num_of_providers) + xdf$total_patients <- to_num(xdf$total_patients) + xdf$week_start <- MMWRweek::MMWRweek2Date(xdf$year, xdf$week) if (region == "national") xdf$region <- "National" - if (region == "hhs") xdf$region <- factor(xdf$region, levels=sprintf("Region %s", 1:10)) + if (region == "hhs") xdf$region <- factor(xdf$region, levels = sprintf("Region %s", 1:10)) class(xdf) <- c("tbl_df", "tbl", "data.frame") - suppressMessages(readr::type_convert(xdf)) + arrange(suppressMessages(readr::type_convert(xdf)), week_start) } \ No newline at end of file diff --git a/R/mmwr-map.r b/R/mmwr-map.r index e603509..2512b90 100644 --- a/R/mmwr-map.r +++ b/R/mmwr-map.r @@ -53,7 +53,7 @@ NULL #' @return data frame (tibble) #' @export #' @examples -#' mmwr_week(Sys.Date()) +#' mwk <- mmwr_week(Sys.Date()) mmwr_week <- function(x) { x <- as.Date(x) x <- setNames(MMWRweek::MMWRweek(x), c("mmwr_year", "mmwr_week", "mmwr_day")) @@ -76,7 +76,7 @@ mmwr_week <- function(x) { #' @return ordered factor #' @export #' @examples -#' mmwr_weekday(Sys.Date()) +#' mwday <- mmwr_weekday(Sys.Date()) mmwr_weekday <- function(x, abbr = FALSE) { x <- as.Date(x) x <- MMWRweek::MMWRweekday(x) @@ -103,7 +103,7 @@ mmwr_weekday <- function(x, abbr = FALSE) { #' @return vector of `Date` objects #' @export #' @examples -#' mmwr_week_to_date(2016,10,3) +#' mwd <- mmwr_week_to_date(2016,10,3) mmwr_week_to_date <- function(year, week, day=NULL) { year <- as.numeric(year) diff --git a/R/pi-mortality.r b/R/pi-mortality.r index 561d9f9..d385bc3 100644 --- a/R/pi-mortality.r +++ b/R/pi-mortality.r @@ -114,11 +114,11 @@ pi_mortality <- function(coverage_area=c("national", "state", "region"), years=N res <- httr::content(res, as="parsed", flatten=TRUE) - dplyr::bind_rows(res$seasons) %>% + suppressWarnings(suppressMessages(dplyr::bind_rows(res$seasons) %>% dplyr::left_join(mapcode_df, "map_code") %>% dplyr::left_join(geo_df, "geoid") %>% dplyr::left_join(age_df, "ageid") %>% - dplyr::left_join(dplyr::mutate(mmwrid_map, mmwrid=as.character(mmwrid)), "mmwrid") -> xdf + dplyr::left_join(dplyr::mutate(mmwrid_map, mmwrid=as.character(mmwrid)), "mmwrid") -> xdf)) xdf <- dplyr::mutate(xdf, coverage_area = coverage_area) @@ -136,15 +136,14 @@ pi_mortality <- function(coverage_area=c("national", "state", "region"), years=N "age_label", "wk_start", "wk_end", "year_wk_num", "mmwrid", "coverage_area", "region_name", "callout")] -> xdf - suppressWarnings(xdf$baseline <- to_num(xdf$baseline) / 100) - suppressWarnings(xdf$threshold <- to_num(xdf$threshold) / 100) - suppressWarnings(xdf$percent_pni <- to_num(xdf$percent_pni) / 100) - suppressWarnings(xdf$percent_complete <- to_num(xdf$percent_complete) / 100) - suppressWarnings(xdf$number_influenza <- to_num(xdf$number_influenza)) - suppressWarnings(xdf$number_pneumonia <- to_num(xdf$number_pneumonia)) - suppressWarnings(xdf$all_deaths <- to_num(xdf$all_deaths)) - suppressWarnings(xdf$Total_PnI <- to_num(xdf$Total_PnI)) - + xdf$baseline <- to_num(xdf$baseline) / 100 + xdf$threshold <- to_num(xdf$threshold) / 100 + xdf$percent_pni <- to_num(xdf$percent_pni) / 100 + xdf$percent_complete <- to_num(xdf$percent_complete) / 100 + xdf$number_influenza <- to_num(xdf$number_influenza) + xdf$number_pneumonia <- to_num(xdf$number_pneumonia) + xdf$all_deaths <- to_num(xdf$all_deaths) + xdf$Total_PnI <- to_num(xdf$Total_PnI) xdf <- .mcga(xdf) xdf diff --git a/R/utils.r b/R/utils.r index b4956b3..b443a7d 100644 --- a/R/utils.r +++ b/R/utils.r @@ -20,5 +20,5 @@ to_num <- function(x) { x <- gsub("<", "", x, fixed=TRUE) x <- gsub(",", "", x, fixed=TRUE) x <- gsub(" ", "", x, fixed=TRUE) - as.numeric(x) + suppressWarnings(as.numeric(x)) } diff --git a/R/zzz.r b/R/zzz.r index 861dd5a..727bb77 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -7,8 +7,4 @@ "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 5b50dcc..85d2d10 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,7 +1,7 @@ --- -title: "" -pagetitle: "" output: rmarkdown::github_document +editor_options: + chunk_output_type: console --- ```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.retina=2) @@ -21,7 +21,7 @@ If there's a particular data set from https://www.cdc.gov/flu/weekly/fluviewinte # :mask: cdcfluview -Retrieve U.S. Flu Season Data from the CDC FluView Portal +Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal ## Description @@ -63,9 +63,22 @@ The following data sets are included: - `census_regions`: Census Region Table (a data frame with 51 rows and 2 variables) - `mmwrid_map`: MMWR ID to Calendar Mappings (it is exported & available, no need to use `data()`) +## NOTE + +All development happens in branches now with only critical fixes being back-ported to the master branch when necessary. + ## Installation ```{r eval=FALSE} +# CRAN +install.packages("cdcfluview") +# 0.9.0 branch (where all fixes are) +devtools::install_git("https://sr.ht/~hrbrmstr/cdcfluview", ref= "0.9.0") +devtools::install_git("https://gitlab.com/hrbrmstr/cdcfluview", ref = "0.9.0") +devtools::install_github("hrbrmstr/cdcfluview", ref = "0.9.0") +# master branch +devtools::install_git("https://sr.ht/~hrbrmstr/cdcfluview") +devtools::install_git("https://gitlab.com/hrbrmstr/cdcfluview") devtools::install_github("hrbrmstr/cdcfluview") ``` @@ -214,6 +227,12 @@ who_nrevss("census", years=2016) who_nrevss("state", years=2016) ``` +## cdcfluview Metrics + +```{r echo=FALSE} +cloc::cloc_pkg_md() +``` + ## 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 deleted file mode 100644 index 0d9da2b..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png and /dev/null 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 deleted file mode 100644 index 83a7e3d..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png and /dev/null 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 deleted file mode 100644 index 9d6b0b3..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-1.png and /dev/null 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 deleted file mode 100644 index 843f862..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-2.png and /dev/null 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 deleted file mode 100644 index 10fc9ef..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-3.png and /dev/null 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 deleted file mode 100644 index 482c8bc..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-4.png and /dev/null 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 deleted file mode 100644 index 929679c..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-5.png and /dev/null 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 deleted file mode 100644 index 736cf6d..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-5-6.png and /dev/null 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 deleted file mode 100644 index 0c9233f..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-7-1.png and /dev/null 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 deleted file mode 100644 index 1abfc60..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-1.png and /dev/null 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 deleted file mode 100644 index 99310a0..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-2.png and /dev/null 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 deleted file mode 100644 index ccb17b0..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-3.png and /dev/null 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 deleted file mode 100644 index 1b0f116..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-8-4.png and /dev/null 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 deleted file mode 100644 index 99147a5..0000000 Binary files a/README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-9-1.png and /dev/null differ diff --git a/README.md b/README.md index 33b1fa8..bd023e5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ specific as you can (screen shot if possible). # :mask: cdcfluview -Retrieve U.S. Flu Season Data from the CDC FluView Portal +Retrieve Flu Season Data from the United States Centers for Disease +Control and Prevention (‘CDC’) ‘FluView’ Portal ## Description @@ -83,9 +84,23 @@ The following data sets are included: - `mmwrid_map`: MMWR ID to Calendar Mappings (it is exported & available, no need to use `data()`) +## NOTE + +All development happens in branches now with only critical fixes being +back-ported to the master branch when necessary. + ## Installation ``` r +# CRAN +install.packages("cdcfluview") +# 0.9.0 branch (where all fixes are) +devtools::install_git("https://sr.ht/~hrbrmstr/cdcfluview", ref= "0.9.0") +devtools::install_git("https://gitlab.com/hrbrmstr/cdcfluview", ref = "0.9.0") +devtools::install_github("hrbrmstr/cdcfluview", ref = "0.9.0") +# master branch +devtools::install_git("https://sr.ht/~hrbrmstr/cdcfluview") +devtools::install_git("https://gitlab.com/hrbrmstr/cdcfluview") devtools::install_github("hrbrmstr/cdcfluview") ``` @@ -110,22 +125,22 @@ glimpse(age_group_distribution(years=2015)) ## Observations: 1,872 ## Variables: 16 - ## $ sea_label "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "... - ## $ age_label 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... - ## $ vir_label A (Subtyping not Performed), A (Subtyping not Performed), A (Subtyping not Performed), A ... - ## $ count 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,... - ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820,... - ## $ seasonid 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 5... - ## $ publishyearweekid 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956, 2956,... - ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16",... - ## $ sea_startweek 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806,... - ## $ sea_endweek 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857,... - ## $ vir_description "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk",... - ## $ vir_startmmwrid 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,... - ## $ vir_endmmwrid 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131,... - ## $ wk_start 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015... - ## $ wk_end 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015... - ## $ year_wk_num 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... + ## $ sea_label "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20… + ## $ age_label 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 A (Subtyping not Performed), A (Subtyping not Performed), A (Subtyping not Performed), A (S… + ## $ count 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 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2… + ## $ seasonid 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,… + ## $ publishyearweekid 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2976, 2… + ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "… + ## $ sea_startweek 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2806, 2… + ## $ sea_endweek 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2857, 2… + ## $ vir_description "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "A-Unk", "… + ## $ vir_startmmwrid 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1… + ## $ vir_endmmwrid 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3… + ## $ wk_start 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 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 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, … ### Retrieve CDC U.S. Coverage Map @@ -171,15 +186,15 @@ plot(cdc_basemap("surv")) glimpse(geographic_spread()) ``` - ## Observations: 27,351 + ## Observations: 28,151 ## Variables: 7 - ## $ statename "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "... - ## $ url "http://adph.org/influenza/", "http://adph.org/influenza/", "http://adph.org/influenza/",... - ## $ website "Influenza Surveillance", "Influenza Surveillance", "Influenza Surveillance", "Influenza ... - ## $ activity_estimate "No Activity", "No Activity", "No Activity", "Local Activity", "Sporadic", "Sporadic", "S... - ## $ weekend 2003-10-04, 2003-10-11, 2003-10-18, 2003-10-25, 2003-11-01, 2003-11-08, 2003-11-15, 2003... - ## $ season "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "... - ## $ weeknumber "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "1", ... + ## $ statename "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Al… + ## $ url "http://adph.org/influenza/", "http://adph.org/influenza/", "http://adph.org/influenza/", "… + ## $ website "Influenza Surveillance", "Influenza Surveillance", "Influenza Surveillance", "Influenza Su… + ## $ activity_estimate "No Activity", "No Activity", "No Activity", "Local Activity", "Sporadic", "Sporadic", "Spo… + ## $ weekend 2003-10-04, 2003-10-11, 2003-10-18, 2003-10-25, 2003-11-01, 2003-11-08, 2003-11-15, 2003-1… + ## $ season "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "2003-04", "20… + ## $ weeknumber "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "1", "2… ### Laboratory-Confirmed Influenza Hospitalizations @@ -215,22 +230,22 @@ surveillance_areas() glimpse(fs_nat <- hospitalizations("flusurv")) ``` - ## Observations: 1,656 + ## Observations: 1,746 ## Variables: 14 - ## $ surveillance_area "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET",... - ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network",... - ## $ year 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009,... - ## $ season 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 4... - ## $ wk_start 2009-08-30, 2009-09-06, 2009-09-13, 2009-09-20, 2009-09-27, 2009-10-04, 2009-10-11, 2009... - ## $ wk_end 2009-09-05, 2009-09-12, 2009-09-19, 2009-09-26, 2009-10-03, 2009-10-10, 2009-10-17, 2009... - ## $ year_wk_num 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6,... - ## $ rate 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.... - ## $ weeklyrate 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.... - ## $ age 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 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... - ## $ sea_label "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "... - ## $ sea_description "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10",... - ## $ mmwrid 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502,... + ## $ surveillance_area "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "FluSurv-NET", "… + ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "… + ## $ year 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2… + ## $ season 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 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 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 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 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 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 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 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 "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "2009-10", "20… + ## $ sea_description "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "Season 2009-10", "… + ## $ mmwrid 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2… ``` r ggplot(fs_nat, aes(wk_end, rate)) + @@ -250,20 +265,20 @@ glimpse(hospitalizations("eip", years=2015)) ## Observations: 180 ## Variables: 14 - ## $ surveillance_area "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP"... - ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network",... - ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016,... - ## $ season 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 5... - ## $ wk_start 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015... - ## $ wk_end 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015... - ## $ year_wk_num 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 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.2, 5.3,... - ## $ weeklyrate 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,... - ## $ age 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 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... - ## $ sea_label "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "... - ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16",... - ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820,... + ## $ surveillance_area "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", … + ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "… + ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2… + ## $ season 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 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 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 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 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 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 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 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 "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20… + ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "… + ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2… ``` r glimpse(hospitalizations("eip", "Colorado", years=2015)) @@ -271,20 +286,20 @@ glimpse(hospitalizations("eip", "Colorado", years=2015)) ## Observations: 180 ## Variables: 14 - ## $ surveillance_area "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP"... - ## $ region "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colo... - ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016,... - ## $ season 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 5... - ## $ wk_start 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015... - ## $ wk_end 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015... - ## $ year_wk_num 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 0.0, 0.0, 0.6, 0.6, 0.6, 0.6, 1.2, 1.8, 1.8, 1.8, 1.8, 1.8, 2.9, 3.5, 3.5, 3.5, 4.1, 6.4,... - ## $ weeklyrate 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,... - ## $ age 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 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... - ## $ sea_label "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "... - ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16",... - ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820,... + ## $ surveillance_area "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", "EIP", … + ## $ region "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colorado", "Colora… + ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2… + ## $ season 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 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 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 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 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 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 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 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 "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20… + ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "… + ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2… ``` r glimpse(hospitalizations("ihsp", years=2015)) @@ -292,20 +307,20 @@ glimpse(hospitalizations("ihsp", years=2015)) ## Observations: 180 ## Variables: 14 - ## $ surveillance_area "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "... - ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network",... - ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016,... - ## $ season 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 5... - ## $ wk_start 2015-10-04, 2015-10-11, 2015-10-18, 2015-10-25, 2015-11-01, 2015-11-08, 2015-11-15, 2015... - ## $ wk_end 2015-10-10, 2015-10-17, 2015-10-24, 2015-10-31, 2015-11-07, 2015-11-14, 2015-11-21, 2015... - ## $ year_wk_num 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 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.5, 2.5, 2.5, 2.9, 4.0,... - ## $ weeklyrate 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,... - ## $ age 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 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... - ## $ sea_label "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "... - ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16",... - ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820,... + ## $ surveillance_area "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH… + ## $ region "Entire Network", "Entire Network", "Entire Network", "Entire Network", "Entire Network", "… + ## $ year 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016, 2… + ## $ season 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 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 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 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 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 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 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 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 "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "20… + ## $ sea_description "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "Season 2015-16", "… + ## $ mmwrid 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2… ``` r glimpse(hospitalizations("ihsp", "Oklahoma", years=2015)) @@ -313,20 +328,20 @@ glimpse(hospitalizations("ihsp", "Oklahoma", years=2015)) ## Observations: 180 ## Variables: 14 - ## $ surveillance_area "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "... - ## $ region "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Okla... - ## $ year 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011,... - ## $ season 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5... - ## $ wk_start 2010-10-03, 2010-10-10, 2010-10-17, 2010-10-24, 2010-10-31, 2010-11-07, 2010-11-14, 2010... - ## $ wk_end 2010-10-09, 2010-10-16, 2010-10-23, 2010-10-30, 2010-11-06, 2010-11-13, 2010-11-20, 2010... - ## $ year_wk_num 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 0.0, 0.0, 1.3, 1.3, 1.3, 1.3, 1.3, 1.3, 1.3, 2.6, 2.6, 6.6, 15.9, 18.5, 35.7, 54.2, 83.4,... - ## $ weeklyrate 0.0, 0.0, 1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.3, 0.0, 4.0, 9.3, 2.6, 17.2, 18.5, 29.1, 2... - ## $ age 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 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... - ## $ sea_label "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "... - ## $ sea_description "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11",... - ## $ mmwrid 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559,... + ## $ surveillance_area "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IHSP", "IH… + ## $ region "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklahoma", "Oklaho… + ## $ year 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011, 2… + ## $ season 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 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 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 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 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 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 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 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 "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "2010-11", "20… + ## $ sea_description "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "Season 2010-11", "… + ## $ mmwrid 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2… ### Retrieve ILINet Surveillance Data @@ -349,146 +364,146 @@ walk(c("national", "hhs", "census", "state"), ~{ }) ``` - ## Observations: 1,093 + ## Observations: 1,111 ## Variables: 16 - ## $ region_type "National", "National", "National", "National", "National", "National", "National", "Natio... - ## $ region "National", "National", "National", "National", "National", "National", "National", "Natio... - ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, ... - ## $ week 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,... - ## $ weighted_ili 1.101480, 1.200070, 1.378760, 1.199200, 1.656180, 1.413260, 1.986800, 2.447490, 1.739010, ... - ## $ unweighted_ili 1.216860, 1.280640, 1.239060, 1.144730, 1.261120, 1.282750, 1.445790, 1.647960, 1.675170, ... - ## $ age_0_4 179, 199, 228, 188, 217, 178, 294, 288, 268, 299, 346, 348, 510, 579, 639, 690, 856, 824, ... - ## $ age_25_49 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 157, 151, 153, 193, 162, 148, 240, 293, 206, 282, 268, 235, 404, 584, 759, 654, 679, 817, ... - ## $ age_5_24 205, 242, 266, 236, 280, 281, 328, 456, 343, 415, 388, 362, 492, 576, 810, 1121, 1440, 160... - ## $ age_50_64 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 29, 23, 34, 36, 41, 48, 70, 63, 69, 102, 81, 59, 113, 207, 207, 148, 151, 196, 233, 146, 1... - ## $ ilitotal 570, 615, 681, 653, 700, 655, 932, 1100, 886, 1098, 1083, 1004, 1519, 1946, 2415, 2613, 31... - ## $ num_of_providers 192, 191, 219, 213, 213, 195, 248, 256, 252, 253, 242, 190, 251, 250, 254, 255, 245, 245, ... - ## $ total_patients 46842, 48023, 54961, 57044, 55506, 51062, 64463, 66749, 52890, 67887, 61314, 47719, 48429,... - ## $ week_start 1997-10-06, 1997-10-13, 1997-10-20, 1997-10-27, 1997-11-03, 1997-11-10, 1997-11-17, 1997-... - ## # A tibble: 1,093 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 - ## - ## 1 National National 1997 40 1.10 1.22 179 NA 157 205 NA 29 - ## 2 National National 1997 41 1.20 1.28 199 NA 151 242 NA 23 - ## 3 National National 1997 42 1.38 1.24 228 NA 153 266 NA 34 - ## 4 National National 1997 43 1.20 1.14 188 NA 193 236 NA 36 - ## 5 National National 1997 44 1.66 1.26 217 NA 162 280 NA 41 - ## 6 National National 1997 45 1.41 1.28 178 NA 148 281 NA 48 - ## 7 National National 1997 46 1.99 1.45 294 NA 240 328 NA 70 - ## 8 National National 1997 47 2.45 1.65 288 NA 293 456 NA 63 - ## 9 National National 1997 48 1.74 1.68 268 NA 206 343 NA 69 - ## 10 National National 1997 49 1.94 1.62 299 NA 282 415 NA 102 - ## # ... with 1,083 more rows, and 4 more variables: ilitotal , num_of_providers , total_patients , + ## $ region_type "National", "National", "National", "National", "National", "National", "National", "Nationa… + ## $ region "National", "National", "National", "National", "National", "National", "National", "Nationa… + ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, 19… + ## $ week 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 1.101480, 1.200070, 1.378760, 1.199200, 1.656180, 1.413260, 1.986800, 2.447490, 1.739010, 1.… + ## $ unweighted_ili 1.216860, 1.280640, 1.239060, 1.144730, 1.261120, 1.282750, 1.445790, 1.647960, 1.675170, 1.… + ## $ age_0_4 179, 199, 228, 188, 217, 178, 294, 288, 268, 299, 346, 348, 510, 579, 639, 690, 856, 824, 88… + ## $ age_25_49 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 157, 151, 153, 193, 162, 148, 240, 293, 206, 282, 268, 235, 404, 584, 759, 654, 679, 817, 76… + ## $ age_5_24 205, 242, 266, 236, 280, 281, 328, 456, 343, 415, 388, 362, 492, 576, 810, 1121, 1440, 1600,… + ## $ age_50_64 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 29, 23, 34, 36, 41, 48, 70, 63, 69, 102, 81, 59, 113, 207, 207, 148, 151, 196, 233, 146, 119… + ## $ ilitotal 570, 615, 681, 653, 700, 655, 932, 1100, 886, 1098, 1083, 1004, 1519, 1946, 2415, 2613, 3126… + ## $ num_of_providers 192, 191, 219, 213, 213, 195, 248, 256, 252, 253, 242, 190, 251, 250, 254, 255, 245, 245, 23… + ## $ total_patients 46842, 48023, 54961, 57044, 55506, 51062, 64463, 66749, 52890, 67887, 61314, 47719, 48429, 5… + ## $ week_start 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 + ## + ## 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 , num_of_providers , total_patients , ## # week_start - ## Observations: 10,930 + ## Observations: 11,110 ## Variables: 16 - ## $ region_type "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", ... - ## $ region Region 1, Region 2, Region 3, Region 4, Region 5, Region 6, Region 7, Region 8, Region 9, ... - ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, ... - ## $ week 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 0.498535, 0.374963, 1.354280, 0.400338, 1.229260, 1.018980, 0.871791, 0.516017, 1.807610, ... - ## $ unweighted_ili 0.623848, 0.384615, 1.341720, 0.450010, 0.901266, 0.747384, 1.152860, 0.422654, 2.258780, ... - ## $ age_0_4 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 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 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, ... - ## $ age_5_24 22, 0, 15, 11, 30, 2, 18, 3, 74, 30, 29, 0, 16, 14, 41, 2, 13, 8, 84, 35, 35, 0, 24, 18, 7... - ## $ age_50_64 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 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, ... - ## $ ilitotal 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 32, 7, 16, 29, 49, 4, 14, 5, 23, 13, 29, 7, 17, 31, 48, 4, 14, 6, 23, 12, 40, 7, 15, 33, 6... - ## $ total_patients 7053, 780, 2385, 10222, 9875, 669, 2342, 1183, 10758, 1575, 6987, 872, 2740, 11310, 9618, ... - ## $ week_start 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-... - ## # A tibble: 10,930 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 - ## - ## 1 HHS Regions Region 1 1997 40 0.499 0.624 15 NA 7 22 NA 0 - ## 2 HHS Regions Region 2 1997 40 0.375 0.385 0 NA 3 0 NA 0 - ## 3 HHS Regions Region 3 1997 40 1.35 1.34 6 NA 7 15 NA 4 - ## 4 HHS Regions Region 4 1997 40 0.400 0.450 12 NA 23 11 NA 0 - ## 5 HHS Regions Region 5 1997 40 1.23 0.901 31 NA 24 30 NA 4 - ## 6 HHS Regions Region 6 1997 40 1.02 0.747 2 NA 1 2 NA 0 - ## 7 HHS Regions Region 7 1997 40 0.872 1.15 0 NA 4 18 NA 5 - ## 8 HHS Regions Region 8 1997 40 0.516 0.423 2 NA 0 3 NA 0 - ## 9 HHS Regions Region 9 1997 40 1.81 2.26 80 NA 76 74 NA 13 - ## 10 HHS Regions Region 10 1997 40 4.74 4.83 31 NA 12 30 NA 3 - ## # ... with 10,920 more rows, and 4 more variables: ilitotal , num_of_providers , total_patients , + ## $ region_type "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "HHS Regions", "H… + ## $ region Region 1, Region 2, Region 3, Region 4, Region 5, Region 6, Region 7, Region 8, Region 9, Re… + ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19… + ## $ week 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 0.498535, 0.374963, 1.354280, 0.400338, 1.229260, 1.018980, 0.871791, 0.516017, 1.807610, 4.… + ## $ unweighted_ili 0.623848, 0.384615, 1.341720, 0.450010, 0.901266, 0.747384, 1.152860, 0.422654, 2.258780, 4.… + ## $ age_0_4 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 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 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 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 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 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 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 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 7053, 780, 2385, 10222, 9875, 669, 2342, 1183, 10758, 1575, 6987, 872, 2740, 11310, 9618, 68… + ## $ week_start 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 + ## + ## 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 , num_of_providers , total_patients , ## # week_start - ## Observations: 9,837 + ## Observations: 9,999 ## Variables: 16 - ## $ region_type "Census Regions", "Census Regions", "Census Regions", "Census Regions", "Census Regions", ... - ## $ region "New England", "Mid-Atlantic", "East North Central", "West North Central", "South Atlantic... - ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, ... - ## $ week 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 0.4985350, 0.8441440, 0.7924860, 1.7640500, 0.5026620, 0.0542283, 1.0189800, 2.2587800, 2.... - ## $ unweighted_ili 0.6238480, 1.3213800, 0.8187380, 1.2793900, 0.7233800, 0.0688705, 0.7473840, 2.2763300, 3.... - ## $ age_0_4 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 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 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, 5... - ## $ age_5_24 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 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 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, ... - ## $ ilitotal 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 32, 13, 47, 17, 30, 9, 4, 16, 24, 29, 13, 46, 17, 32, 10, 4, 17, 23, 40, 12, 62, 16, 33, 1... - ## $ total_patients 7053, 2119, 9649, 2892, 6912, 4356, 669, 10719, 2473, 6987, 2384, 9427, 2823, 7591, 4947, ... - ## $ week_start 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-10-06, 1997-... - ## # A tibble: 9,837 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 - ## - ## 1 Census Regi… New Engl… 1997 40 0.499 0.624 15 NA 7 22 NA 0 - ## 2 Census Regi… Mid-Atla… 1997 40 0.844 1.32 4 NA 8 12 NA 4 - ## 3 Census Regi… East Nor… 1997 40 0.792 0.819 28 NA 20 28 NA 3 - ## 4 Census Regi… West Nor… 1997 40 1.76 1.28 3 NA 8 20 NA 6 - ## 5 Census Regi… South At… 1997 40 0.503 0.723 14 NA 22 14 NA 0 - ## 6 Census Regi… East Sou… 1997 40 0.0542 0.0689 0 NA 3 0 NA 0 - ## 7 Census Regi… West Sou… 1997 40 1.02 0.747 2 NA 1 2 NA 0 - ## 8 Census Regi… Mountain 1997 40 2.26 2.28 87 NA 71 71 NA 15 - ## 9 Census Regi… Pacific 1997 40 2.05 3.23 26 NA 17 36 NA 1 - ## 10 Census Regi… New Engl… 1997 41 0.643 0.816 14 NA 14 29 NA 0 - ## # ... with 9,827 more rows, and 4 more variables: ilitotal , num_of_providers , total_patients , + ## $ region_type "Census Regions", "Census Regions", "Census Regions", "Census Regions", "Census Regions", "C… + ## $ region "New England", "Mid-Atlantic", "East North Central", "West North Central", "South Atlantic",… + ## $ year 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 19… + ## $ week 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 0.4985350, 0.8441440, 0.7924860, 1.7640500, 0.5026620, 0.0542283, 1.0189800, 2.2587800, 2.04… + ## $ unweighted_ili 0.6238480, 1.3213800, 0.8187380, 1.2793900, 0.7233800, 0.0688705, 0.7473840, 2.2763300, 3.23… + ## $ age_0_4 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 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 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 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 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 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 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 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 7053, 2119, 9649, 2892, 6912, 4356, 669, 10719, 2473, 6987, 2384, 9427, 2823, 7591, 4947, 68… + ## $ week_start 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 + ## + ## 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 , num_of_providers , total_patients , ## # week_start - ## Observations: 22,148 + ## Observations: 23,120 ## Variables: 16 - ## $ region_type "States", "States", "States", "States", "States", "States", "States", "States", "States", ... - ## $ region "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Dela... - ## $ year 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, ... - ## $ week 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 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 2.1347700, 0.8751460, 0.6747210, 0.6960560, 1.9541200, 0.6606840, 0.0783085, 0.1001250, 2.... - ## $ age_0_4 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 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 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 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 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 NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA... - ## $ ilitotal 249, 15, 172, 18, 632, 134, 3, 4, 73, NA, 647, 20, 19, 505, 65, 10, 39, 19, 391, 22, 117, ... - ## $ num_of_providers 35, 7, 49, 15, 112, 14, 12, 13, 4, NA, 62, 18, 12, 74, 44, 6, 40, 14, 41, 30, 17, 56, 47, ... - ## $ total_patients 11664, 1714, 25492, 2586, 32342, 20282, 3831, 3995, 2599, NA, 40314, 1943, 4579, 39390, 12... - ## $ week_start 2010-10-04, 2010-10-04, 2010-10-04, 2010-10-04, 2010-10-04, 2010-10-04, 2010-10-04, 2010-... - ## # A tibble: 22,148 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 - ## - ## 1 States Alabama 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 Arizona 2010 40 NA 0.675 NA NA NA NA NA NA - ## 4 States Arkansas 2010 40 NA 0.696 NA NA NA NA NA NA - ## 5 States California 2010 40 NA 1.95 NA NA NA NA NA NA - ## 6 States Colorado 2010 40 NA 0.661 NA NA NA NA NA NA - ## 7 States Connectic… 2010 40 NA 0.0783 NA NA NA NA NA NA - ## 8 States Delaware 2010 40 NA 0.100 NA NA NA NA NA NA - ## 9 States District … 2010 40 NA 2.81 NA NA NA NA NA NA - ## 10 States Florida 2010 40 NA NA NA NA NA NA NA NA - ## # ... with 22,138 more rows, and 4 more variables: ilitotal , num_of_providers , total_patients , + ## $ region_type "States", "States", "States", "States", "States", "States", "States", "States", "States", "S… + ## $ region "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delawa… + ## $ year 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 20… + ## $ week 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 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 2.1347700, 0.8751460, 0.6747210, 0.6960560, 1.9541200, 0.6606840, 0.0783085, 0.1001250, 2.80… + ## $ age_0_4 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 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 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 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 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 NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … + ## $ ilitotal 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 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 11664, 1714, 25492, 2586, 32342, 20282, 3831, 3995, 2599, NA, 40314, 1943, 4579, 39390, 1252… + ## $ week_start 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 + ## + ## 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 , num_of_providers , total_patients , ## # week_start @@ -499,20 +514,20 @@ walk(c("national", "hhs", "census", "state"), ~{ ili_weekly_activity_indicators(2017) ``` - ## # A tibble: 1,782 x 8 - ## statename url website activity_level activity_level_label weekend season weeknumber - ## * - ## 1 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-07 2017-18 40 - ## 2 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-14 2017-18 41 - ## 3 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-21 2017-18 42 - ## 4 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-10-28 2017-18 43 - ## 5 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-11-04 2017-18 44 - ## 6 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-11-11 2017-18 45 - ## 7 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-02 2017-18 48 - ## 8 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-09 2017-18 49 - ## 9 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-23 2017-18 51 - ## 10 Virgin Islands http://doh.vi.gov/ Influenza 0 Insufficient Data 2017-12-30 2017-18 52 - ## # ... with 1,772 more rows + ## # A tibble: 2,805 x 8 + ## statename url website activity_level activity_level_l… weekend season weeknumber + ## * + ## 1 Alabama http://adph.org/influenza/ Influenza Sur… 2 Minimal 2017-10-07 2017-… 40 + ## 2 Alaska "http://dhss.alaska.gov/dp… Influenza Sur… 1 Minimal 2017-10-07 2017-… 40 + ## 3 Arizona http://www.azdhs.gov/phs/o… Influenza & R… 2 Minimal 2017-10-07 2017-… 40 + ## 4 Arkansas http://www.healthy.arkansa… Communicable … 1 Minimal 2017-10-07 2017-… 40 + ## 5 California https://www.cdph.ca.gov/Pr… Influenza (Fl… 2 Minimal 2017-10-07 2017-… 40 + ## 6 Colorado https://www.colorado.gov/p… Influenza Sur… 1 Minimal 2017-10-07 2017-… 40 + ## 7 Connecticut http://www.portal.ct.gov/D… Flu Statistics 1 Minimal 2017-10-07 2017-… 40 + ## 8 Delaware http://dhss.delaware.gov/d… Weekly Influe… 1 Minimal 2017-10-07 2017-… 40 + ## 9 District of… http://doh.dc.gov/page/inf… Influenza Inf… 2 Minimal 2017-10-07 2017-… 40 + ## 10 Florida "http://www.floridahealth.… Weekly Influe… 1 Minimal 2017-10-07 2017-… 40 + ## # … with 2,795 more rows ``` r xdf <- map_df(2008:2017, ili_weekly_activity_indicators) @@ -537,20 +552,20 @@ count(xdf, weekend, activity_level_label) %>% (nat_pi <- pi_mortality("national")) ``` - ## # A tibble: 464 x 19 + ## # A tibble: 483 x 19 ## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni ## - ## 1 57 0.057 0.06 0.0580 1 16 3020 52110 3036 - ## 2 57 0.0580 0.061 0.059 1 18 3000 51572 3018 - ## 3 57 0.059 0.062 0.061 1 28 3154 52222 3182 - ## 4 57 0.06 0.063 0.063 1 23 3279 52548 3302 - ## 5 57 0.06 0.063 0.061 1 36 3214 53679 3250 - ## 6 57 0.061 0.064 0.06 1 45 3177 53258 3222 - ## 7 57 0.062 0.065 0.063 1 50 3315 53771 3365 - ## 8 57 0.063 0.066 0.06 1 48 3200 54120 3248 - ## 9 57 0.064 0.067 0.065 1 83 3491 54760 3574 - ## 10 57 0.065 0.068 0.066 1 118 3526 55595 3644 - ## # ... with 454 more rows, and 10 more variables: weeknumber , geo_description , age_label , + ## 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 , geo_description , age_label , ## # wk_start , wk_end , year_wk_num , mmwrid , coverage_area , region_name , ## # callout @@ -578,7 +593,7 @@ select(nat_pi, wk_end, percent_pni, baseline, threshold) %>% ## ## 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 977 52 + ## 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 @@ -586,7 +601,7 @@ select(nat_pi, wk_end, percent_pni, baseline, threshold) %>% ## 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 , geo_description , age_label , + ## # … with 2,694 more rows, and 10 more variables: weeknumber , geo_description , age_label , ## # wk_start , wk_end , year_wk_num , mmwrid , coverage_area , region_name , ## # callout @@ -597,17 +612,17 @@ select(nat_pi, wk_end, percent_pni, baseline, threshold) %>% ## # A tibble: 520 x 19 ## seasonid baseline threshold percent_pni percent_complete number_influenza number_pneumonia all_deaths total_pni ## - ## 1 55 0.066 0.073 0.071 1 0 178 2520 178 - ## 2 55 0.067 0.074 0.063 1 0 159 2505 159 - ## 3 55 0.067 0.075 0.0580 1 1 141 2452 142 - ## 4 55 0.068 0.076 0.071 1 0 171 2422 171 - ## 5 55 0.07 0.077 0.066 1 2 166 2554 168 - ## 6 55 0.071 0.078 0.067 1 1 160 2404 161 - ## 7 55 0.072 0.079 0.079 1 0 195 2478 195 - ## 8 55 0.073 0.081 0.072 1 1 176 2463 177 - ## 9 55 0.074 0.0820 0.067 1 3 154 2347 157 - ## 10 55 0.076 0.083 0.062 1 0 151 2437 151 - ## # ... with 510 more rows, and 10 more variables: weeknumber , geo_description , age_label , + ## 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 , geo_description , age_label , ## # wk_start , wk_end , year_wk_num , mmwrid , coverage_area , region_name , ## # callout @@ -618,19 +633,19 @@ state_data_providers() ``` ## # A tibble: 59 x 5 - ## statename statehealthdeptname url statewebsitename statefluphonenum - ## * - ## 1 Alabama Alabama Department of Public Health http://… Influenza Surve… 334-206-5300 - ## 2 Alaska State of Alaska Health and Social Services "http:/… Influenza Surve… 907-269-8000 - ## 3 Arizona Arizona Department of Health Services http://… Influenza & RSV… 602-542-1025 - ## 4 Arkansas Arkansas Department of Health http://… Communicable Di… 501-661-2000 - ## 5 California California Department of Public Health https:/… Influenza (Flu) 916-558-1784 - ## 6 Colorado Colorado Department of Public Health and Environment https:/… Influenza Surve… 303-692-2000 - ## 7 Connecticut Connecticut Department of Public Health http://… Flu Statistics 860-509-8000 - ## 8 Delaware Delaware Health and Social Services http://… Weekly Influenz… 302-744-4700 - ## 9 District of Columbia District of Columbia Department of Health http://… Influenza Infor… 202-442-5955 - ## 10 Florida Florida Department of Health "http:/… Weekly Influenz… 850-245-4300 - ## # ... with 49 more rows + ## statename statehealthdeptname url statewebsitename statefluphonenum + ## * + ## 1 Alabama Alabama Department of Publi… http://adph.org/influenza/ Influenza Surveillance 334-206-5300 + ## 2 Alaska State of Alaska Health and … "http://dhss.alaska.gov/dph/Epi/… Influenza Surveillance… 907-269-8000 + ## 3 Arizona Arizona Department of Healt… http://www.azdhs.gov/phs/oids/ep… Influenza & RSV Survei… 602-542-1025 + ## 4 Arkansas Arkansas Department of Heal… http://www.healthy.arkansas.gov/… Communicable Disease a… 501-661-2000 + ## 5 California California Department of Pu… https://www.cdph.ca.gov/Programs… Influenza (Flu) 916-558-1784 + ## 6 Colorado Colorado Department of Publ… https://www.colorado.gov/pacific… Influenza Surveillance 303-692-2000 + ## 7 Connecticut Connecticut Department of P… http://www.portal.ct.gov/DPH/Inf… Flu Statistics 860-509-8000 + ## 8 Delaware Delaware Health and Social … http://dhss.delaware.gov/dhss/dp… Weekly Influenza Surve… 302-744-4700 + ## 9 District of … District of Columbia Depart… http://doh.dc.gov/page/influenza… Influenza Information 202-442-5955 + ## 10 Florida Florida Department of Health "http://www.floridahealth.gov/di… Weekly Influenza Surve… 850-245-4300 + ## # … with 49 more rows ### Retrieve WHO/NREVSS Surveillance Data @@ -654,32 +669,32 @@ glimpse(xdat <- who_nrevss("national")) ## ..$ b : int [1:940] 0 0 1 0 0 0 1 1 1 1 ... ## ..$ h3n2v : int [1:940] 0 0 0 0 0 0 0 0 0 0 ... ## ..$ wk_date : Date[1:940], format: "1997-09-28" "1997-10-05" "1997-10-12" "1997-10-19" ... - ## $ public_health_labs :Classes 'tbl_df', 'tbl' and 'data.frame': 153 obs. of 13 variables: - ## ..$ region_type : chr [1:153] "National" "National" "National" "National" ... - ## ..$ region : chr [1:153] "National" "National" "National" "National" ... - ## ..$ year : int [1:153] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ... - ## ..$ week : int [1:153] 40 41 42 43 44 45 46 47 48 49 ... - ## ..$ total_specimens : int [1:153] 1139 1152 1198 1244 1465 1393 1458 1157 1550 1518 ... - ## ..$ a_2009_h1n1 : int [1:153] 4 5 10 9 4 11 17 17 27 38 ... - ## ..$ a_h3 : int [1:153] 65 41 50 31 23 34 42 24 36 37 ... - ## ..$ a_subtyping_not_performed: int [1:153] 2 2 1 4 4 1 1 0 3 3 ... - ## ..$ b : int [1:153] 10 7 8 9 9 10 4 4 9 11 ... - ## ..$ bvic : int [1:153] 0 3 3 1 1 4 0 3 3 2 ... - ## ..$ byam : int [1:153] 1 0 2 4 4 2 4 9 12 11 ... - ## ..$ h3n2v : int [1:153] 0 0 0 0 0 0 0 0 0 0 ... - ## ..$ wk_date : Date[1:153], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ... - ## $ clinical_labs :Classes 'tbl_df', 'tbl' and 'data.frame': 153 obs. of 11 variables: - ## ..$ region_type : chr [1:153] "National" "National" "National" "National" ... - ## ..$ region : chr [1:153] "National" "National" "National" "National" ... - ## ..$ year : int [1:153] 2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ... - ## ..$ week : int [1:153] 40 41 42 43 44 45 46 47 48 49 ... - ## ..$ total_specimens : int [1:153] 12029 13111 13441 13537 14687 15048 15250 15234 16201 16673 ... - ## ..$ total_a : int [1:153] 84 116 97 98 97 122 84 119 145 140 ... - ## ..$ total_b : int [1:153] 43 54 52 52 68 86 98 92 81 106 ... - ## ..$ percent_positive: num [1:153] 1.06 1.3 1.11 1.11 1.12 ... - ## ..$ percent_a : num [1:153] 0.698 0.885 0.722 0.724 0.66 ... - ## ..$ percent_b : num [1:153] 0.357 0.412 0.387 0.384 0.463 ... - ## ..$ wk_date : Date[1:153], format: "2015-10-04" "2015-10-11" "2015-10-18" "2015-10-25" ... + ## $ 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" ... ``` r mutate(xdat$combined_prior_to_2015_16, @@ -699,19 +714,19 @@ who_nrevss("hhs", years=2016) ## $public_health_labs ## # A tibble: 520 x 13 - ## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date - ## - ## 1 HHS Regions Regio… 2016 40 31 0 6 0 0 0 0 0 2016-10-02 - ## 2 HHS Regions Regio… 2016 40 31 0 6 0 0 2 0 0 2016-10-02 - ## 3 HHS Regions Regio… 2016 40 112 2 2 0 0 0 0 0 2016-10-02 - ## 4 HHS Regions Regio… 2016 40 112 1 11 0 1 2 0 0 2016-10-02 - ## 5 HHS Regions Regio… 2016 40 204 0 7 0 0 0 1 0 2016-10-02 - ## 6 HHS Regions Regio… 2016 40 39 1 1 0 0 0 0 0 2016-10-02 - ## 7 HHS Regions Regio… 2016 40 24 0 2 0 0 1 0 0 2016-10-02 - ## 8 HHS Regions Regio… 2016 40 46 2 8 0 0 0 0 0 2016-10-02 - ## 9 HHS Regions Regio… 2016 40 186 3 27 0 0 0 3 0 2016-10-02 - ## 10 HHS Regions Regio… 2016 40 113 0 17 0 0 0 0 0 2016-10-02 - ## # ... with 510 more rows + ## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date + ## + ## 1 HHS Regions Region… 2016 40 31 0 6 0 0 0 0 0 2016-10-02 + ## 2 HHS Regions Region… 2016 40 31 0 6 0 0 2 0 0 2016-10-02 + ## 3 HHS Regions Region… 2016 40 112 2 2 0 0 0 0 0 2016-10-02 + ## 4 HHS Regions Region… 2016 40 112 1 11 0 1 2 0 0 2016-10-02 + ## 5 HHS Regions Region… 2016 40 204 0 7 0 0 0 1 0 2016-10-02 + ## 6 HHS Regions Region… 2016 40 39 1 1 0 0 0 0 0 2016-10-02 + ## 7 HHS Regions Region… 2016 40 24 0 2 0 0 1 0 0 2016-10-02 + ## 8 HHS Regions Region… 2016 40 46 2 8 0 0 0 0 0 2016-10-02 + ## 9 HHS Regions Region… 2016 40 186 3 27 0 0 0 3 0 2016-10-02 + ## 10 HHS Regions Region… 2016 40 113 0 17 0 0 0 0 0 2016-10-02 + ## # … with 510 more rows ## ## $clinical_labs ## # A tibble: 520 x 11 @@ -727,7 +742,7 @@ who_nrevss("hhs", years=2016) ## 8 HHS Regions Region 8 2016 40 913 8 0 0.876 0.876 0 2016-10-02 ## 9 HHS Regions Region 9 2016 40 992 6 1 0.706 0.605 0.101 2016-10-02 ## 10 HHS Regions Region 10 2016 40 590 14 0 2.37 2.37 0 2016-10-02 - ## # ... with 510 more rows + ## # … with 510 more rows ``` r who_nrevss("census", years=2016) @@ -735,35 +750,35 @@ who_nrevss("census", years=2016) ## $public_health_labs ## # A tibble: 468 x 13 - ## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date - ## - ## 1 Census Reg… New E… 2016 40 31 0 6 0 0 0 0 0 2016-10-02 - ## 2 Census Reg… Mid-A… 2016 40 50 0 8 0 0 2 0 0 2016-10-02 - ## 3 Census Reg… East … 2016 40 139 0 4 0 0 0 1 0 2016-10-02 - ## 4 Census Reg… West … 2016 40 103 0 6 0 0 1 0 0 2016-10-02 - ## 5 Census Reg… South… 2016 40 181 3 11 0 1 2 0 0 2016-10-02 - ## 6 Census Reg… East … 2016 40 24 0 0 0 0 0 0 0 2016-10-02 - ## 7 Census Reg… West … 2016 40 27 0 1 0 0 0 0 0 2016-10-02 - ## 8 Census Reg… Mount… 2016 40 54 3 10 0 0 0 1 0 2016-10-02 - ## 9 Census Reg… Pacif… 2016 40 289 3 41 0 0 0 2 0 2016-10-02 - ## 10 Census Reg… New E… 2016 41 14 0 2 0 0 0 0 0 2016-10-09 - ## # ... with 458 more rows + ## region_type region year week total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v wk_date + ## + ## 1 Census Regi… New E… 2016 40 31 0 6 0 0 0 0 0 2016-10-02 + ## 2 Census Regi… Mid-A… 2016 40 50 0 8 0 0 2 0 0 2016-10-02 + ## 3 Census Regi… East … 2016 40 139 0 4 0 0 0 1 0 2016-10-02 + ## 4 Census Regi… West … 2016 40 103 0 6 0 0 1 0 0 2016-10-02 + ## 5 Census Regi… South… 2016 40 181 3 11 0 1 2 0 0 2016-10-02 + ## 6 Census Regi… East … 2016 40 24 0 0 0 0 0 0 0 2016-10-02 + ## 7 Census Regi… West … 2016 40 27 0 1 0 0 0 0 0 2016-10-02 + ## 8 Census Regi… Mount… 2016 40 54 3 10 0 0 0 1 0 2016-10-02 + ## 9 Census Regi… Pacif… 2016 40 289 3 41 0 0 0 2 0 2016-10-02 + ## 10 Census Regi… New E… 2016 41 14 0 2 0 0 0 0 0 2016-10-09 + ## # … with 458 more rows ## ## $clinical_labs ## # A tibble: 468 x 11 - ## region_type region year week total_specimens total_a total_b percent_positive percent_a percent_b wk_date - ## - ## 1 Census Regions New Engl… 2016 40 654 5 1 0.917 0.765 0.153 2016-10-02 - ## 2 Census Regions Mid-Atla… 2016 40 1579 10 4 0.887 0.633 0.253 2016-10-02 - ## 3 Census Regions East Nor… 2016 40 2176 6 5 0.506 0.276 0.230 2016-10-02 - ## 4 Census Regions West Nor… 2016 40 1104 3 0 0.272 0.272 0 2016-10-02 - ## 5 Census Regions South At… 2016 40 2785 43 62 3.77 1.54 2.23 2016-10-02 - ## 6 Census Regions East Sou… 2016 40 844 4 4 0.948 0.474 0.474 2016-10-02 - ## 7 Census Regions West Sou… 2016 40 1738 21 13 1.96 1.21 0.748 2016-10-02 - ## 8 Census Regions Mountain 2016 40 1067 8 0 0.750 0.750 0 2016-10-02 - ## 9 Census Regions Pacific 2016 40 1433 20 1 1.47 1.40 0.0698 2016-10-02 - ## 10 Census Regions New Engl… 2016 41 810 5 1 0.741 0.617 0.123 2016-10-09 - ## # ... with 458 more rows + ## region_type region year week total_specimens total_a total_b percent_positive percent_a percent_b wk_date + ## + ## 1 Census Regio… New England 2016 40 654 5 1 0.917 0.765 0.153 2016-10-02 + ## 2 Census Regio… Mid-Atlant… 2016 40 1579 10 4 0.887 0.633 0.253 2016-10-02 + ## 3 Census Regio… East North… 2016 40 2176 6 5 0.506 0.276 0.230 2016-10-02 + ## 4 Census Regio… West North… 2016 40 1104 3 0 0.272 0.272 0 2016-10-02 + ## 5 Census Regio… South Atla… 2016 40 2785 43 62 3.77 1.54 2.23 2016-10-02 + ## 6 Census Regio… East South… 2016 40 844 4 4 0.948 0.474 0.474 2016-10-02 + ## 7 Census Regio… West South… 2016 40 1738 21 13 1.96 1.21 0.748 2016-10-02 + ## 8 Census Regio… Mountain 2016 40 1067 8 0 0.750 0.750 0 2016-10-02 + ## 9 Census Regio… Pacific 2016 40 1433 20 1 1.47 1.40 0.0698 2016-10-02 + ## 10 Census Regio… New England 2016 41 810 5 1 0.741 0.617 0.123 2016-10-09 + ## # … with 458 more rows ``` r who_nrevss("state", years=2016) @@ -771,35 +786,43 @@ who_nrevss("state", years=2016) ## $public_health_labs ## # A tibble: 54 x 12 - ## region_type region season_descript… total_specimens a_2009_h1n1 a_h3 a_subtyping_not_p… b bvic byam h3n2v - ## - ## 1 States Alabama Season 2016-17 570 3 227 1 2 15 14 0 - ## 2 States Alaska Season 2016-17 5222 14 905 3 252 2 11 0 - ## 3 States Arizona Season 2016-17 2975 63 1630 0 5 227 578 0 - ## 4 States Arkansas Season 2016-17 121 0 51 0 0 4 0 0 - ## 5 States California Season 2016-17 14074 184 4696 120 116 28 152 0 - ## 6 States Colorado Season 2016-17 714 3 267 2 4 31 219 0 - ## 7 States Connectic… Season 2016-17 1348 19 968 0 0 62 263 0 - ## 8 States Delaware Season 2016-17 3090 5 659 4 11 27 127 1 - ## 9 States District … Season 2016-17 73 1 34 0 3 0 4 0 - ## 10 States Florida Season 2016-17 - ## # ... with 44 more rows, and 1 more variable: wk_date + ## region_type region season_descript… total_specimens a_2009_h1n1 a_h3 a_subtyping_not… b bvic byam h3n2v + ## + ## 1 States Alaba… Season 2016-17 570 3 227 1 2 15 14 0 + ## 2 States Alaska Season 2016-17 5222 14 905 3 252 2 11 0 + ## 3 States Arizo… Season 2016-17 2975 63 1630 0 5 227 578 0 + ## 4 States Arkan… Season 2016-17 121 0 51 0 0 4 0 0 + ## 5 States Calif… Season 2016-17 14074 184 4696 120 116 28 152 0 + ## 6 States Color… Season 2016-17 714 3 267 2 4 31 219 0 + ## 7 States Conne… Season 2016-17 1348 19 968 0 0 62 263 0 + ## 8 States Delaw… Season 2016-17 3090 5 659 4 11 27 127 1 + ## 9 States Distr… Season 2016-17 73 1 34 0 3 0 4 0 + ## 10 States Flori… Season 2016-17 + ## # … with 44 more rows, and 1 more variable: wk_date ## ## $clinical_labs ## # A tibble: 2,808 x 11 - ## region_type region year week total_specimens total_a total_b percent_positive percent_a percent_b wk_date - ## - ## 1 States Alabama 2016 40 406 4 1 1.23 0.99 0.25 2016-10-02 - ## 2 States Alaska 2016 40 2016-10-02 - ## 3 States Arizona 2016 40 133 0 0 0 0 0 2016-10-02 - ## 4 States Arkansas 2016 40 47 0 0 0 0 0 2016-10-02 - ## 5 States California 2016 40 668 2 0 0.3 0.3 0 2016-10-02 - ## 6 States Colorado 2016 40 260 0 0 0 0 0 2016-10-02 - ## 7 States Connecticut 2016 40 199 3 0 1.51 1.51 0 2016-10-02 - ## 8 States Delaware 2016 40 40 0 0 0 0 0 2016-10-02 - ## 9 States District of… 2016 40 2016-10-02 - ## 10 States Florida 2016 40 2016-10-02 - ## # ... with 2,798 more rows + ## region_type region year week total_specimens total_a total_b percent_positive percent_a percent_b wk_date + ## + ## 1 States Alabama 2016 40 406 4 1 1.23 0.99 0.25 2016-10-02 + ## 2 States Alaska 2016 40 2016-10-02 + ## 3 States Arizona 2016 40 133 0 0 0 0 0 2016-10-02 + ## 4 States Arkansas 2016 40 47 0 0 0 0 0 2016-10-02 + ## 5 States California 2016 40 668 2 0 0.3 0.3 0 2016-10-02 + ## 6 States Colorado 2016 40 260 0 0 0 0 0 2016-10-02 + ## 7 States Connecticut 2016 40 199 3 0 1.51 1.51 0 2016-10-02 + ## 8 States Delaware 2016 40 40 0 0 0 0 0 2016-10-02 + ## 9 States District of … 2016 40 2016-10-02 + ## 10 States Florida 2016 40 2016-10-02 + ## # … with 2,798 more rows + +## cdcfluview Metrics + +| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | +| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: | +| R | 21 | 0.91 | 837 | 0.88 | 302 | 0.79 | 521 | 0.85 | +| Rmd | 1 | 0.04 | 83 | 0.09 | 67 | 0.18 | 88 | 0.14 | +| make | 1 | 0.04 | 32 | 0.03 | 11 | 0.03 | 1 | 0.00 | ## Code of Conduct diff --git a/README_files/figure-gfm/cdc-basemaps-2.png b/README_files/figure-gfm/cdc-basemaps-2.png index 920c195..9b56ea1 100644 Binary files a/README_files/figure-gfm/cdc-basemaps-2.png and b/README_files/figure-gfm/cdc-basemaps-2.png differ diff --git a/README_files/figure-gfm/ili-df-1.png b/README_files/figure-gfm/ili-df-1.png index 5dbdaed..0ef27bb 100644 Binary files a/README_files/figure-gfm/ili-df-1.png and b/README_files/figure-gfm/ili-df-1.png differ diff --git a/README_files/figure-gfm/ili-df-2.png b/README_files/figure-gfm/ili-df-2.png index 026e674..c83dcc9 100644 Binary files a/README_files/figure-gfm/ili-df-2.png and b/README_files/figure-gfm/ili-df-2.png differ diff --git a/README_files/figure-gfm/ili-df-3.png b/README_files/figure-gfm/ili-df-3.png index 9c992cf..e21a8c4 100644 Binary files a/README_files/figure-gfm/ili-df-3.png and b/README_files/figure-gfm/ili-df-3.png differ diff --git a/README_files/figure-gfm/ili-df-4.png b/README_files/figure-gfm/ili-df-4.png index d92d5a9..f9c4a4a 100644 Binary files a/README_files/figure-gfm/ili-df-4.png and b/README_files/figure-gfm/ili-df-4.png differ diff --git a/README_files/figure-gfm/ili-weekly-activity-1.png b/README_files/figure-gfm/ili-weekly-activity-1.png index 6854314..78402c4 100644 Binary files a/README_files/figure-gfm/ili-weekly-activity-1.png and b/README_files/figure-gfm/ili-weekly-activity-1.png differ diff --git a/README_files/figure-gfm/nat-pi-mortality-1.png b/README_files/figure-gfm/nat-pi-mortality-1.png index 6ce7b76..b332668 100644 Binary files a/README_files/figure-gfm/nat-pi-mortality-1.png and b/README_files/figure-gfm/nat-pi-mortality-1.png differ diff --git a/README_files/figure-gfm/surveillance-areas-1.png b/README_files/figure-gfm/surveillance-areas-1.png index 38ebad1..76ac6ad 100644 Binary files a/README_files/figure-gfm/surveillance-areas-1.png and b/README_files/figure-gfm/surveillance-areas-1.png differ diff --git a/README_files/figure-gfm/who-vrevss-1.png b/README_files/figure-gfm/who-vrevss-1.png index a110d0d..0044c11 100644 Binary files a/README_files/figure-gfm/who-vrevss-1.png and b/README_files/figure-gfm/who-vrevss-1.png differ diff --git a/man/age_group_distribution.Rd b/man/age_group_distribution.Rd index d462f31..05e8e62 100644 --- a/man/age_group_distribution.Rd +++ b/man/age_group_distribution.Rd @@ -20,7 +20,7 @@ public health laboratories by influenza virus type and subtype/lineage. Laborato from multiple seasons and different age groups is provided. } \examples{ -age_group_distribution(years=2015) +agd <- age_group_distribution(years=2015) } \references{ \itemize{ diff --git a/man/cdcfluview.Rd b/man/cdcfluview.Rd index 727c5e3..a5aa25e 100644 --- a/man/cdcfluview.Rd +++ b/man/cdcfluview.Rd @@ -4,7 +4,7 @@ \name{cdcfluview} \alias{cdcfluview} \alias{cdcfluview-package} -\title{Retrieve 'U.S'.' Flu Season Data from the 'CDC' 'FluView' Portal} +\title{Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal} \description{ The U.S. Centers for Disease Control (CDC) maintains a portal \url{http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html} for diff --git a/man/geographic_spread.Rd b/man/geographic_spread.Rd index e83907f..360f8e0 100644 --- a/man/geographic_spread.Rd +++ b/man/geographic_spread.Rd @@ -20,6 +20,6 @@ State and Territorial Epidemiologists Reports of Geographic Spread of Influenza } \examples{ \dontrun{ -geographic_spread() +gs <- geographic_spread() } } diff --git a/man/get_flu_data.Rd b/man/get_flu_data.Rd index 9c99f83..fc0904e 100644 --- a/man/get_flu_data.Rd +++ b/man/get_flu_data.Rd @@ -4,8 +4,9 @@ \alias{get_flu_data} \title{Retrieves state, regional or national influenza statistics from the CDC (deprecated)} \usage{ -get_flu_data(region = "hhs", sub_region = 1:10, data_source = "ilinet", - years = as.numeric(format(Sys.Date(), "\%Y"))) +get_flu_data(region = "hhs", sub_region = 1:10, + data_source = "ilinet", years = as.numeric(format(Sys.Date(), + "\%Y"))) } \arguments{ \item{region}{one of "\code{hhs}", "\code{census}", "\code{national}", @@ -47,8 +48,3 @@ There is often a noticeable delay when making the API request to the CDC. servers to crunch the data. Wrap the function call in \code{httr::with_verbose} if you would like to see what's going on. } -\examples{ -\dontrun{ -flu <- get_flu_data("hhs", 1:10, c("who", "ilinet"), years=2000:2014) -} -} diff --git a/man/get_hosp_data.Rd b/man/get_hosp_data.Rd index c841c1e..b4c4e08 100644 --- a/man/get_hosp_data.Rd +++ b/man/get_hosp_data.Rd @@ -38,6 +38,6 @@ There is often a noticeable delay when making the API request to the CDC. \examples{ \dontrun{ # All of FluSurv-NET, 50-64 years old, 2010/11-2014/15 flu seasons -flu <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014) +hosp <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014) } } diff --git a/man/get_state_data.Rd b/man/get_state_data.Rd index 075f29c..3a34cb7 100644 --- a/man/get_state_data.Rd +++ b/man/get_state_data.Rd @@ -31,10 +31,9 @@ There is often a noticeable delay when making the API request to the CDC. This if you would like to see what's going on. } \examples{ -get_state_data(2014) +state_data <- get_state_data(2014) \dontrun{ -get_state_data(c(2013, 2014)) -get_state_data(2010:2014) -httr::with_verbose(get_state_data(2009:2015)) +gsd <- get_state_data(c(2013, 2014)) +gsd <- get_state_data(2010:2014) } } diff --git a/man/get_weekly_flu_report.Rd b/man/get_weekly_flu_report.Rd index 5f4963a..0e0c8fc 100644 --- a/man/get_weekly_flu_report.Rd +++ b/man/get_weekly_flu_report.Rd @@ -23,7 +23,7 @@ the reporting source metadata and a limit on the historical flu information. } \examples{ \dontrun{ -get_weekly_flu_report() +wfr <- get_weekly_flu_report() } } \references{ diff --git a/man/ili_weekly_activity_indicators.Rd b/man/ili_weekly_activity_indicators.Rd index 011e37f..2f09eb7 100644 --- a/man/ili_weekly_activity_indicators.Rd +++ b/man/ili_weekly_activity_indicators.Rd @@ -35,7 +35,7 @@ with data presented by the state likely being the more complete. } \examples{ \dontrun{ -ili_weekly_activity_indicators(2016) +iwai <- ili_weekly_activity_indicators(2016) } } \references{ diff --git a/man/ilinet.Rd b/man/ilinet.Rd index 469179d..3fabd3d 100644 --- a/man/ilinet.Rd +++ b/man/ilinet.Rd @@ -27,16 +27,14 @@ This function retrieves current and historical ILINet surveillance data for the identified region. } \examples{ -national_ili <- ilinet("national", years=2017) +national_ili <- ilinet("national", years = 2017) \dontrun{ hhs_ili <- ilinet("hhs") census_ili <- ilinet("census") state_ili <- ilinet("state") -library(purrr) -map_df( - c("national", "hhs", "census", "state"), - ~ilinet(.x)) +all_ili <- suppressWarnings( + suppressMessages(purrr::map_df(c("national", "hhs", "census", "state"), ilinet))) } } \references{ diff --git a/man/mmwr_week.Rd b/man/mmwr_week.Rd index fbc7e53..63a97b3 100644 --- a/man/mmwr_week.Rd +++ b/man/mmwr_week.Rd @@ -17,5 +17,5 @@ This is a reformat and re-export of a function in the \code{MMWRweek} package. It provides a snake case version of its counterpart, produces a \code{tibble} } \examples{ -mmwr_week(Sys.Date()) +mwk <- mmwr_week(Sys.Date()) } diff --git a/man/mmwr_week_to_date.Rd b/man/mmwr_week_to_date.Rd index 10d8c59..87b7852 100644 --- a/man/mmwr_week_to_date.Rd +++ b/man/mmwr_week_to_date.Rd @@ -20,5 +20,5 @@ of \code{Date} objects that corresponds to the input MMWR year+week or year+week vectors. This also adds some parameter checking and cleanup to avoid exceptions. } \examples{ -mmwr_week_to_date(2016,10,3) +mwd <- mmwr_week_to_date(2016,10,3) } diff --git a/man/mmwr_weekday.Rd b/man/mmwr_weekday.Rd index 743a946..e4cfb01 100644 --- a/man/mmwr_weekday.Rd +++ b/man/mmwr_weekday.Rd @@ -25,5 +25,5 @@ Weekday names are explicitly mapped to "Sunday-Saturday" or "Sun-Sat" and do not change with your locale. } \examples{ -mmwr_weekday(Sys.Date()) +mwday <- mmwr_weekday(Sys.Date()) } diff --git a/man/pi_mortality.Rd b/man/pi_mortality.Rd index 40ca323..852b3fd 100644 --- a/man/pi_mortality.Rd +++ b/man/pi_mortality.Rd @@ -4,7 +4,8 @@ \alias{pi_mortality} \title{Pneumonia and Influenza Mortality Surveillance} \usage{ -pi_mortality(coverage_area = c("national", "state", "region"), years = NULL) +pi_mortality(coverage_area = c("national", "state", "region"), + years = NULL) } \arguments{ \item{coverage_area}{coverage area for data (national, state or region)} diff --git a/man/state_data_providers.Rd b/man/state_data_providers.Rd index 1d860bb..98237a2 100644 --- a/man/state_data_providers.Rd +++ b/man/state_data_providers.Rd @@ -10,5 +10,5 @@ state_data_providers() Retrieve metadata about U.S. State CDC Provider Data } \examples{ -state_data_providers() +sdp <- state_data_providers() } diff --git a/man/surveillance_areas.Rd b/man/surveillance_areas.Rd index 686f8ca..ae05c7e 100644 --- a/man/surveillance_areas.Rd +++ b/man/surveillance_areas.Rd @@ -10,5 +10,5 @@ surveillance_areas() Retrieve a list of valid sub-regions for each surveillance area. } \examples{ -surveillance_areas() +sa <- surveillance_areas() } diff --git a/man/who_nrevss.Rd b/man/who_nrevss.Rd index a021ecd..7405aae 100644 --- a/man/who_nrevss.Rd +++ b/man/who_nrevss.Rd @@ -4,7 +4,8 @@ \alias{who_nrevss} \title{Retrieve WHO/NREVSS Surveillance Data} \usage{ -who_nrevss(region = c("national", "hhs", "census", "state"), years = NULL) +who_nrevss(region = c("national", "hhs", "census", "state"), + years = NULL) } \arguments{ \item{region}{one of "\code{national}", "\code{hhs}", "\code{census}", or "\code{state}"} diff --git a/tests/testthat/test-cdcfluview.R b/tests/testthat/test-cdcfluview.R index 3fb8db2..d032bae 100644 --- a/tests/testthat/test-cdcfluview.R +++ b/tests/testthat/test-cdcfluview.R @@ -16,6 +16,9 @@ test_that("New API works", { skip_on_cran() + nat_dat <- ilinet(region="national", years=1997:2018) + expect_equal(unique(diff(nat_dat$week_start)), 7) + expect_that(ilinet("national", years=2017), is_a("data.frame")) expect_that(ilinet("hhs", years=2017), is_a("data.frame")) expect_that(ilinet("census", years=2017), is_a("data.frame"))