@ -1,8 +1,8 @@
Package: cdcfluview
Type: Package
Title: Retrieve U.S. Flu Season Data from the CDC FluView Portal
Version: 0.5.1
Version: 0.5.2
Date: 2016-12-06
Date: 2017-01-02
Author: Bob Rudis (bob@rud.is)
Maintainer: Bob Rudis <bob@rud.is>
Encoding: UTF-8
@ -1,4 +1,10 @@
# cscfluview 0.5.1
# cdcfluview 0.5.2
* Modified behavior of `get_flu_data()` to actually grab current flu season year
if a single year was specified and it is the current year and the return is a 0 length
data frame #7
# cdcfluview 0.5.1
* Replaced `http` URLs with `https` as `http` ones no longer work (fixes #6)
* Fixed State data download (CDC changed the hidden API)
@ -98,7 +98,19 @@ get_flu_data <- function(region="hhs", sub_region=1:10,
names(file_list) <- substr(basename(files), 1, 3)
if (length(file_list) == 1) {
return(file_list[[1]])
file_list <- file_list[[1]]
if ((nrow(file_list) == 0) &
(length(years)==1) &
(years == (as.numeric(format(Sys.Date(), "%Y"))-1960))) {
message("Adjusting [years] to get current season...")
return(get_flu_data(region=region, sub_region=sub_region,
data_source=data_source, years=years+1960-1))
} else {
return(file_list)
}