Browse Source
Merge pull request #22 from asbates/consistent-week-naming
consistent week naming for `pi_mortality` and `ilinet`
master
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
18 additions and
2 deletions
-
DESCRIPTION
-
NEWS.md
-
R/aaa.R
-
R/pi-mortality.r
-
man/pi_mortality.Rd
|
|
@ -15,7 +15,8 @@ Authors@R: c( |
|
|
|
person("Sebastian", "Meyer", email = "seb.meyer@fau.de", role = "ctb", |
|
|
|
comment = c(ORCID = "0000-0002-1791-9449")), |
|
|
|
person("James", "Turtle", email = "jturtle@predsci.com", role = "ctb", |
|
|
|
comment = c(ORCID = "0000-0003-0735-7769")) |
|
|
|
comment = c(ORCID = "0000-0003-0735-7769")), |
|
|
|
person("Andrew", "Bates", role = "ctb") |
|
|
|
) |
|
|
|
Maintainer: Bob Rudis <bob@rud.is> |
|
|
|
Description: The 'U.S.' Centers for Disease Control and Prevention (CDC) maintain |
|
|
|
|
|
@ -1,3 +1,8 @@ |
|
|
|
#cdcfluview 0.9.1 |
|
|
|
|
|
|
|
- renamed `pi_mortality` columns regarding the week to `week_*` instead of `wk_*` |
|
|
|
for consistency with `ilinet` (#21). |
|
|
|
|
|
|
|
# cdcfluview 0.9.0 |
|
|
|
|
|
|
|
- fix bug in epiweek computation in ilinet() thanks to a bug report by @jturtle (#19) |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
utils::globalVariables(c(".", "mmwrid", "season", "seasonid", "week_start")) |
|
|
|
utils::globalVariables(c(".", "mmwrid", "season", "seasonid", "week_start", "wk_start", "wk_end", "year_wk_num")) |
|
|
|
|
|
|
|
# CDC U.S. region names to ID map |
|
|
|
.region_map <- c(national=3, hhs=1, census=2, state=5) |
|
|
|
|
|
@ -37,6 +37,8 @@ |
|
|
|
#' the function is smart enough to retrieve by season ID vs convert that |
|
|
|
#' to a year. |
|
|
|
#' @note Queries for "state" and "region" are not necessarily as "instantaneous" as other API endpoints and can near or over 30s retrieval delays. |
|
|
|
#' |
|
|
|
#' For consistency with \code{\link{ilinet}} columns indicating the week now contain 'week' instead of the previously abbreviation 'wk'. |
|
|
|
#' @references |
|
|
|
#' - [Pneumonia and Influenza Mortality Surveillance Portal](https://gis.cdc.gov/grasp/fluview/mortality.html) |
|
|
|
#' @export |
|
|
@ -144,6 +146,12 @@ pi_mortality <- function(coverage_area=c("national", "state", "region"), years=N |
|
|
|
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 <- xdf %>% |
|
|
|
dplyr::rename( |
|
|
|
week_start = wk_start, |
|
|
|
week_end = wk_end, |
|
|
|
year_week_num = year_wk_num |
|
|
|
) |
|
|
|
xdf <- .mcga(xdf) |
|
|
|
|
|
|
|
xdf |
|
|
|
|
|
@ -48,6 +48,8 @@ calculated at the national and regional level and by age group. |
|
|
|
} |
|
|
|
\note{ |
|
|
|
Queries for "state" and "region" are not necessarily as "instantaneous" as other API endpoints and can near or over 30s retrieval delays. |
|
|
|
|
|
|
|
For consistency with \code{\link{ilinet}} columns indicating the week now contain 'week' instead of the previously abbreviation 'wk'. |
|
|
|
} |
|
|
|
\examples{ |
|
|
|
\dontrun{ |
|
|
|