Browse Source

README fix + needed lib-v8 for travis

tags/v0.5.2
boB Rudis 4 years ago
parent
commit
b1fe479278
6 changed files with 50 additions and 33 deletions
  1. +16
    -0
      .travis.yml
  2. +6
    -5
      README.Rmd
  3. +28
    -28
      README.md
  4. BIN
      README_files/README-bins-1.png
  5. BIN
      README_files/README-mortality-1.png
  6. BIN
      README_files/README-state2015-1.png

+ 16
- 0
.travis.yml View File

@ -3,3 +3,19 @@
language: R
sudo: false
cache: packages
apt_packages:
- libv8-dev
r:
- oldrel
- release
- devel
notifications:
email:
- bob@rud.is
irc:
channels:
- "irc.rud.is#builds"
nick: travisci

+ 6
- 5
README.Rmd View File

@ -15,19 +15,20 @@ knitr::opts_chunk$set(
### :mask: cdcfluview - Retrieve U.S. Flu Season Data from the CDC FluView Portal
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/cdcfluview)](https://cran.r-project.org/package=cdcfluview)
[![Travis-CI Build Status](https://travis-ci.org/NA/NA.svg?branch=master)](https://travis-ci.org/NA/NA)
**NOTE** If there's a particular data set from http://www.cdc.gov/flu/weekly/fluviewinteractive.htm that you want and that isn't in the package, please file it as an issue and be as specific as you can (screen shot if possible).
**NOTE** If there's a particular data set from https://www.cdc.gov/flu/weekly/fluviewinteractive.htm that you want and that isn't in the package, please file it as an issue and be as specific as you can (screen shot if possible).
-----
The U.S. Centers for Disease Control (CDC) maintains a [portal](http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) for accessing state, regional and national influenza statistics. The portal's Flash interface makes it difficult and time-consuming to select and retrieve influenza data. This package provides functions to access the data provided by the portal's underlying API.
The U.S. Centers for Disease Control (CDC) maintains a [portal](https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) for accessing state, regional and national influenza statistics. The portal's Flash interface makes it difficult and time-consuming to select and retrieve influenza data. This package provides functions to access the data provided by the portal's underlying API.
The following functions are implemented:
- `get_flu_data`: Retrieves state, regional or national influenza statistics from the CDC
- `get_state_data`: Retrieves state/territory-level influenza statistics from the CDC
- `get_weekly_flu_report`: Retrieves (high-level) weekly influenza surveillance report from the CDC
- `get_mortality_surveillance_data` : (fairly self explanatory but also pretty new to the pkg and uses data from: http://www.cdc.gov/flu/weekly/nchs.htm
- `get_mortality_surveillance_data` : (fairly self explanatory but also pretty new to the pkg and uses data from: https://www.cdc.gov/flu/weekly/nchs.htm
The following data sets are included:
@ -164,8 +165,8 @@ gg <- gg + theme(axis.text.x=element_blank())
```{r bins, message=FALSE, fig.height=5, fig.width=7}
gg_s <- state_flu %>%
filter(WEEKEND=="Jan-02-2016") %>%
select(state=STATENAME, value=ACTIVITY.LEVEL) %>%
filter(weekend=="Jan-02-2016") %>%
select(state=statename, value=activity_level) %>%
filter(!(state %in% c("Puerto Rico", "New York City"))) %>% # need to add PR to statebins
mutate(value=as.numeric(gsub("Level ", "", value))) %>%
statebins(brewer_pal="RdPu", breaks=4,


+ 28
- 28
README.md View File

@ -1,20 +1,20 @@
### :mask: cdcfluview - Retrieve U.S. Flu Season Data from the CDC FluView Portal
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/cdcfluview)](https://cran.r-project.org/package=cdcfluview)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/cdcfluview)](https://cran.r-project.org/package=cdcfluview) [![Travis-CI Build Status](https://travis-ci.org/NA/NA.svg?branch=master)](https://travis-ci.org/NA/NA)
**NOTE** If there's a particular data set from <http://www.cdc.gov/flu/weekly/fluviewinteractive.htm> that you want and that isn't in the package, please file it as an issue and be as specific as you can (screen shot if possible).
**NOTE** If there's a particular data set from <https://www.cdc.gov/flu/weekly/fluviewinteractive.htm> that you want and that isn't in the package, please file it as an issue and be as specific as you can (screen shot if possible).
------------------------------------------------------------------------
The U.S. Centers for Disease Control (CDC) maintains a [portal](http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) for accessing state, regional and national influenza statistics. The portal's Flash interface makes it difficult and time-consuming to select and retrieve influenza data. This package provides functions to access the data provided by the portal's underlying API.
The U.S. Centers for Disease Control (CDC) maintains a [portal](https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) for accessing state, regional and national influenza statistics. The portal's Flash interface makes it difficult and time-consuming to select and retrieve influenza data. This package provides functions to access the data provided by the portal's underlying API.
The following functions are implemented:
- `get_flu_data`: Retrieves state, regional or national influenza statistics from the CDC
- `get_state_data`: Retrieves state/territory-level influenza statistics from the CDC
- `get_weekly_flu_report`: Retrieves (high-level) weekly influenza surveillance report from the CDC
- `get_mortality_surveillance_data` : (fairly self explanatory but also pretty new to the pkg and uses data from: <http://www.cdc.gov/flu/weekly/nchs.htm>
- `get_mortality_surveillance_data` : (fairly self explanatory but also pretty new to the pkg and uses data from: <https://www.cdc.gov/flu/weekly/nchs.htm>
The following data sets are included:
@ -49,7 +49,7 @@ library(statebins)
# current verison
packageVersion("cdcfluview")
#> [1] '0.5.0'
#> [1] '0.5.1'
flu <- get_flu_data("hhs", sub_region=1:10, "ilinet", years=2014)
glimpse(flu)
@ -59,30 +59,30 @@ glimpse(flu)
#> $ REGION <chr> "Region 1", "Region 2", "Region 3", "Region 4", "Region 5", "Region 6", "Region 7", "Regi...
#> $ YEAR <int> 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 2014,...
#> $ WEEK <int> 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 4...
#> $ % WEIGHTED ILI <dbl> 0.830610, 1.775920, 1.147780, 0.816796, 0.737037, 1.828510, 0.697022, 0.673507, 1.781290,...
#> $ %UNWEIGHTED ILI <dbl> 0.681009, 1.643370, 1.311660, 0.906310, 1.009690, 1.775430, 0.437619, 0.930417, 1.497090,...
#> $ AGE 0-4 <int> 101, 869, 395, 333, 358, 465, 50, 82, 310, 22, 109, 884, 404, 355, 339, 560, 57, 58, 335,...
#> $ AGE 25-49 <int> 44, 363, 455, 187, 181, 469, 43, 87, 220, 7, 37, 385, 466, 247, 182, 504, 56, 87, 225, 20...
#> $ % WEIGHTED ILI <dbl> 0.830610, 1.795830, 1.162260, 0.828920, 0.744546, 1.604740, 0.697022, 0.635856, 1.793140,...
#> $ %UNWEIGHTED ILI <dbl> 0.681009, 1.649790, 1.321020, 0.911243, 1.013950, 1.647270, 0.437619, 0.813397, 1.501530,...
#> $ AGE 0-4 <int> 101, 869, 395, 331, 358, 446, 50, 76, 310, 22, 109, 837, 403, 355, 338, 540, 57, 57, 335,...
#> $ AGE 25-49 <int> 44, 363, 455, 187, 181, 410, 43, 49, 220, 7, 37, 349, 465, 244, 182, 451, 56, 87, 225, 20...
#> $ AGE 25-64 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
#> $ AGE 5-24 <int> 185, 757, 629, 536, 400, 711, 98, 155, 577, 30, 199, 704, 670, 772, 443, 809, 124, 148, 5...
#> $ AGE 50-64 <int> 13, 157, 127, 80, 80, 123, 15, 19, 110, 1, 24, 176, 132, 74, 105, 186, 18, 23, 118, 10, 2...
#> $ AGE 65 <int> 9, 108, 90, 46, 64, 78, 14, 8, 112, 1, 17, 127, 75, 64, 48, 100, 14, 12, 103, 3, 9, 114, ...
#> $ ILITOTAL <int> 352, 2254, 1696, 1182, 1083, 1846, 220, 351, 1329, 61, 386, 2276, 1747, 1512, 1117, 2159,...
#> $ NUM. OF PROVIDERS <int> 147, 285, 244, 305, 267, 241, 84, 120, 240, 55, 151, 275, 241, 311, 277, 250, 84, 116, 24...
#> $ TOTAL PATIENTS <int> 51688, 137157, 129302, 130419, 107261, 103975, 50272, 37725, 88772, 11172, 51169, 134995,...
#> $ AGE 5-24 <int> 185, 757, 627, 530, 400, 636, 98, 154, 577, 30, 199, 676, 669, 772, 443, 741, 124, 148, 5...
#> $ AGE 50-64 <int> 13, 157, 126, 80, 80, 111, 15, 19, 110, 1, 24, 151, 130, 74, 105, 168, 18, 23, 118, 10, 2...
#> $ AGE 65 <int> 9, 107, 89, 46, 64, 77, 14, 8, 112, 1, 17, 115, 75, 64, 48, 97, 14, 12, 103, 3, 9, 114, 8...
#> $ ILITOTAL <int> 352, 2253, 1692, 1174, 1083, 1680, 220, 306, 1329, 61, 386, 2128, 1742, 1509, 1116, 1997,...
#> $ NUM. OF PROVIDERS <int> 146, 276, 234, 299, 261, 226, 84, 119, 237, 55, 150, 265, 232, 306, 271, 235, 84, 115, 24...
#> $ TOTAL PATIENTS <int> 51688, 136563, 128083, 128835, 106810, 101987, 50272, 37620, 88510, 11172, 51169, 131884,...
state_flu <- get_state_data(years=2015)
glimpse(state_flu)
#> Observations: 2,756
#> Observations: 2,807
#> Variables: 8
#> $ STATENAME <chr> "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama", "Alabama"...
#> $ URL <chr> "http://adph.org/influenza/", "http://adph.org/influenza/", "http://adph.org/influenza...
#> $ WEBSITE <chr> "Influenza Surveillance", "Influenza Surveillance", "Influenza Surveillance", "Influen...
#> $ ACTIVITY.LEVEL <chr> "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 3"...
#> $ ACTIVITY.LEVEL.LABEL <chr> "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal"...
#> $ WEEKEND <chr> "Oct-10-2015", "Oct-17-2015", "Oct-24-2015", "Oct-31-2015", "Nov-07-2015", "Nov-14-201...
#> $ WEEK <int> 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,...
#> $ SEASON <chr> "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16"...
#> $ statename <chr> "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "...
#> $ url <chr> "http://adph.org/influenza/", "http://dhss.alaska.gov/dph/Epi/id/Pages/influenza/influ...
#> $ website <chr> "Influenza Surveillance", "Influenza Surveillance Report", "Influenza & RSV Surveillan...
#> $ activity_level <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
#> $ activity_level_label <chr> "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal"...
#> $ weekend <chr> "Oct-10-2015", "Oct-10-2015", "Oct-10-2015", "Oct-10-2015", "Oct-10-2015", "Oct-10-201...
#> $ season <chr> "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16"...
#> $ weeknumber <int> 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40...
gg <- ggplot(flu, aes(x=WEEK, y=`% WEIGHTED ILI`, group=REGION))
gg <- gg + geom_line()
@ -133,8 +133,8 @@ gg
``` r
gg_s <- state_flu %>%
filter(WEEKEND=="Jan-02-2016") %>%
select(state=STATENAME, value=ACTIVITY.LEVEL) %>%
filter(weekend=="Jan-02-2016") %>%
select(state=statename, value=activity_level) %>%
filter(!(state %in% c("Puerto Rico", "New York City"))) %>% # need to add PR to statebins
mutate(value=as.numeric(gsub("Level ", "", value))) %>%
statebins(brewer_pal="RdPu", breaks=4,
@ -153,11 +153,11 @@ library(cdcfluview)
library(testthat)
date()
#> [1] "Mon Sep 26 11:23:17 2016"
#> [1] "Mon Dec 5 14:23:45 2016"
test_dir("tests/")
#> testthat results ========================================================================================================
#> OK: 0 SKIPPED: 0 FAILED: 0
#> OK: 2 SKIPPED: 0 FAILED: 0
#>
#> DONE ===================================================================================================================
```

BIN
README_files/README-bins-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 84 KiB Width: 1344  |  Height: 960  |  Size: 84 KiB

BIN
README_files/README-mortality-1.png View File

Before After
Width: 1920  |  Height: 1152  |  Size: 459 KiB Width: 1920  |  Height: 1152  |  Size: 457 KiB

BIN
README_files/README-state2015-1.png View File

Before After
Width: 1152  |  Height: 1920  |  Size: 188 KiB Width: 1152  |  Height: 1920  |  Size: 190 KiB

Loading…
Cancel
Save