diff --git a/README.Rmd b/README.Rmd index 60b8f03..eb691e6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -58,7 +58,7 @@ options(width=120) ### Usage -```{r message=FALSE, warning=FALSE, fig.height=10, fig.width=6} +```{r state2015, message=FALSE, warning=FALSE, fig.height=10, fig.width=6} library(cdcfluview) library(ggplot2) library(dplyr) @@ -70,7 +70,7 @@ packageVersion("cdcfluview") flu <- get_flu_data("hhs", sub_region=1:10, "ilinet", years=2014) glimpse(flu) -state_flu <- get_state_data(years=2014) +state_flu <- get_state_data(years=2015) glimpse(state_flu) gg <- ggplot(flu, aes(x=WEEK, y=`% WEIGHTED ILI`, group=REGION)) @@ -80,7 +80,7 @@ gg <- gg + theme_bw() gg ``` -```{r message=FALSE, warning=FALSE, fig.height=6, fig.width=10} +```{r mortality, message=FALSE, warning=FALSE, fig.height=6, fig.width=10} msd <- get_mortality_surveillance_data() mutate(msd$by_state, ym=as.Date(sprintf("%04d-%02d-1", Year, Week), "%Y-%U-%u")) %>% @@ -116,7 +116,7 @@ gg <- gg + theme(plot.title=element_text(face="bold", size=16)) gg ``` -```{r eval=FALSE, include=FALSE, warning=FALSE, error=FALSE, message=FALSE} +```{r region, eval=FALSE, include=FALSE, warning=FALSE, error=FALSE, message=FALSE} dat <- get_flu_data(region="hhs", sub_region=1:10, data_source="ilinet", @@ -162,9 +162,9 @@ gg <- gg + theme(axis.ticks.x=element_blank()) gg <- gg + theme(axis.text.x=element_blank()) ``` -```{r message=FALSE, fig.height=5, fig.width=7} +```{r bins, message=FALSE, fig.height=5, fig.width=7} gg_s <- state_flu %>% - filter(WEEKEND=="Jan-03-2015") %>% + 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))) %>% diff --git a/README.md b/README.md index e143e28..0705fa5 100644 --- a/README.md +++ b/README.md @@ -71,18 +71,18 @@ glimpse(flu) #> $ NUM. OF PROVIDERS 147, 285, 244, 305, 267, 241, 84, 120, 240, 55, 151, 275, 241, 311, 277, 250, 84, 116, 24... #> $ TOTAL PATIENTS 51688, 137157, 129302, 130419, 107261, 103975, 50272, 37725, 88772, 11172, 51169, 134995,... -state_flu <- get_state_data(years=2014) +state_flu <- get_state_data(years=2015) glimpse(state_flu) -#> Observations: 2,809 +#> Observations: 2,756 #> Variables: 8 #> $ 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", "Influen... -#> $ ACTIVITY.LEVEL "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 5", "Level 10... -#> $ ACTIVITY.LEVEL.LABEL "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Low", "High", "High... -#> $ WEEKEND "Oct-04-2014", "Oct-11-2014", "Oct-18-2014", "Oct-25-2014", "Nov-01-2014", "Nov-08-201... -#> $ 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,... -#> $ SEASON "2014-15", "2014-15", "2014-15", "2014-15", "2014-15", "2014-15", "2014-15", "2014-15"... +#> $ ACTIVITY.LEVEL "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 1", "Level 3"... +#> $ ACTIVITY.LEVEL.LABEL "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal", "Minimal"... +#> $ WEEKEND "Oct-10-2015", "Oct-17-2015", "Oct-24-2015", "Oct-31-2015", "Nov-07-2015", "Nov-14-201... +#> $ WEEK 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 "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16", "2015-16"... gg <- ggplot(flu, aes(x=WEEK, y=`% WEIGHTED ILI`, group=REGION)) gg <- gg + geom_line() @@ -91,7 +91,7 @@ gg <- gg + theme_bw() gg ``` - + ``` r msd <- get_mortality_surveillance_data() @@ -129,11 +129,11 @@ gg <- gg + theme(plot.title=element_text(face="bold", size=16)) gg ``` - + ``` r gg_s <- state_flu %>% - filter(WEEKEND=="Jan-03-2015") %>% + 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))) %>% @@ -144,7 +144,7 @@ gg_s <- state_flu %>% gg_s ``` - + ### Test Results @@ -153,7 +153,7 @@ library(cdcfluview) library(testthat) date() -#> [1] "Mon Sep 26 11:16:43 2016" +#> [1] "Mon Sep 26 11:23:17 2016" test_dir("tests/") #> testthat results ======================================================================================================== diff --git a/README_files/README-bins-1.png b/README_files/README-bins-1.png new file mode 100644 index 0000000..7dd3cd0 Binary files /dev/null and b/README_files/README-bins-1.png differ diff --git a/README_files/README-mortality-1.png b/README_files/README-mortality-1.png new file mode 100644 index 0000000..e1ca890 Binary files /dev/null and b/README_files/README-mortality-1.png differ diff --git a/README_files/README-state2015-1.png b/README_files/README-state2015-1.png new file mode 100644 index 0000000..8978423 Binary files /dev/null and b/README_files/README-state2015-1.png differ