

{"id":3215,"date":"2015-01-10T21:12:26","date_gmt":"2015-01-11T02:12:26","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3215"},"modified":"2018-03-07T16:44:05","modified_gmt":"2018-03-07T21:44:05","slug":"new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/","title":{"rendered":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#8217;s FluView Portal"},"content":{"rendered":"<p>**NOTE** If there&#8217;s a particular data set from http:\/\/www.cdc.gov\/flu\/weekly\/fluviewinteractive.htm that you want and that isn&#8217;t in the pacakge, please file it as an issue and be as specific as you can (screen shot if possible).<\/p>\n<p>&#8212;&#8211;<\/p>\n<p>Towards the end of 2014 I had been tinkering with flu data from the [CDC&#8217;s FluView portal](http:\/\/gis.cdc.gov\/grasp\/fluview\/fluportaldashboard.html) since flu reports began to look like this season was going to go the way of 2009. <\/p>\n<p>While you can track the flu over at [The Washington Post](http:\/\/www.washingtonpost.com\/graphics\/health\/flu-tracker\/), I like to work with data on my own. However the CDC&#8217;s portal is Flash-driven and there was no obvious way to get the data files programmatically. This is unfortunate, since there are weekly updates to the data set.<\/p>\n<p>As an information security professional, one of the tools in my arsenal is [Burp Proxy](http:\/\/portswigger.net\/burp\/proxy.html), which is an application that&#8212;amongst other things&#8212;lets you configure a local proxy server for your browser and inspect all web requests. By using this tool, I was able to discern that the Flash portal calls out to `http:\/\/gis.cdc.gov\/grasp\/fluview\/FluViewPhase2CustomDownload.ashx` with custom `POST` form parameters (that I also mapped out) to make the data sets it delivers back to the user.<\/p>\n<p>With that information in hand, I whipped together a small R package: [cdcfluview](https:\/\/github.com\/hrbrmstr\/cdcfluview) to interface with the same server the FluView Portal does. It has a singular function &#8211; `get_flu_data` that lets you choose between different region\/sub-region breakdowns and also whether you want data from WHO, ILINet (or both). It also lets you pick which years you want data for.<\/p>\n<p>One reason I wanted to work with the data was to see just how this season differs from previous ones. The view I&#8217;ll leave on the blog this time&#8212;mostly as an example of how to use the package&#8212;is a faceted chart, by CDC region and CDC week showing this season (in red) as it relates to previous ones. <\/p>\n<pre lang=\"rsplus\"># devtools::install_github(\"hrbrmstr\/cdcfluview\") # if necessary\r\nlibrary(cdcfluview)\r\nlibrary(magrittr)\r\nlibrary(dplyr)\r\nlibrary(ggplot2)\r\n\r\ndat <- get_flu_data(region=\"hhs\", \r\n                    sub_region=1:10, \r\n                    data_source=\"ilinet\", \r\n                    years=2000:2014)\r\n\r\ndat %<>%\r\n  mutate(REGION=factor(REGION,\r\n                       levels=unique(REGION),\r\n                       labels=c(\"Boston\", \"New York\",\r\n                                \"Philadelphia\", \"Atlanta\",\r\n                                \"Chicago\", \"Dallas\",\r\n                                \"Kansas City\", \"Denver\",\r\n                                \"San Francisco\", \"Seattle\"),\r\n                       ordered=TRUE)) %>%\r\n  mutate(season_week=ifelse(WEEK>=40, WEEK-40, WEEK),\r\n         season=ifelse(WEEK<40,\r\n                       sprintf(\"%d-%d\", YEAR-1, YEAR),\r\n                       sprintf(\"%d-%d\", YEAR, YEAR+1)))\r\n\r\nprev_years <- dat %>% filter(season != \"2014-2015\")\r\ncurr_year <- dat %>% filter(season == \"2014-2015\")\r\n\r\ncurr_week <- tail(dat, 1)$season_week\r\n\r\ngg <- ggplot()\r\ngg <- gg + geom_point(data=prev_years,\r\n                      aes(x=season_week, y=X..WEIGHTED.ILI, group=season),\r\n                      color=\"#969696\", size=1, alpa=0.25)\r\ngg <- gg + geom_point(data=curr_year,\r\n                      aes(x=season_week, y=X..WEIGHTED.ILI, group=season),\r\n                      color=\"red\", size=1.25, alpha=1)\r\ngg <- gg + geom_line(data=curr_year, \r\n                     aes(x=season_week, y=X..WEIGHTED.ILI, group=season),\r\n                     size=1.25, color=\"#d7301f\")\r\ngg <- gg + geom_vline(xintercept=curr_week, color=\"#d7301f\", size=0.5, linetype=\"dashed\", alpha=0.5)\r\ngg <- gg + facet_wrap(~REGION, ncol=3)\r\ngg <- gg + labs(x=NULL, y=\"Weighted ILI Index\", \r\n                title=\"ILINet - 1999-2015 year weighted flu index history by CDC region\\nWeek Ending Jan 3, 2015 (Red == current season)\\n\")\r\ngg <- gg + theme_bw()\r\ngg <- gg + theme(panel.grid=element_blank())\r\ngg <- gg + theme(strip.background=element_blank())\r\ngg <- gg + theme(axis.ticks.x=element_blank())\r\ngg <- gg + theme(axis.text.x=element_blank())\r\ngg<\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3216\" data-permalink=\"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/flureport\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?fit=600%2C700&amp;ssl=1\" data-orig-size=\"600,700\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"flureport\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?fit=510%2C595&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?resize=510%2C595&#038;ssl=1\" alt=\"flureport\" width=\"510\" height=\"595\" class=\"aligncenter size-full wp-image-3216\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?resize=129%2C150&amp;ssl=1 129w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?resize=257%2C300&amp;ssl=1 257w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?resize=530%2C618&amp;ssl=1 530w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>(You can see an SVG version of that plot [here](http:\/\/rud.is\/dl\/flureport.svg))<\/p>\n<p>Even without looking at the statistics, it's pretty easy to tell that this is fixing to be a pretty bad season in many regions.<\/p>\n<p>### State-level data<\/p>\n<p>Soon after this post I found the state-level API for the CDC FluView interface and added a `get_state_data` function for it:<\/p>\n<pre lang=\"rsplus\">library(statebins)\r\n\r\nget_state_data() %>%\r\n  filter(WEEKEND==\"Jan-03-2015\") %>%\r\n  select(state=STATENAME, value=ACTIVITY.LEVEL) %>%\r\n  filter(!(state %in% c(\"Puerto Rico\", \"New York City\"))) %>% # need to add NYC & PR to statebins\r\n  mutate(value=as.numeric(gsub(\"Level \", \"\", value))) %>%\r\n  statebins(brewer_pal=\"RdPu\", breaks=4,\r\n            labels=c(\"Minimal\", \"Low\", \"Moderate\", \"High\"),\r\n            legend_position=\"bottom\", legend_title=\"ILI Activity Level\") +\r\n  ggtitle(\"CDC State FluView (2014-01-03)\")<\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3233\" data-permalink=\"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/state-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?fit=600%2C450&amp;ssl=1\" data-orig-size=\"600,450\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"state\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?fit=510%2C383&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?resize=510%2C383&#038;ssl=1\" alt=\"state\" width=\"510\" height=\"383\" class=\"aligncenter size-full wp-image-3233\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?resize=150%2C113&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/state1.png?resize=530%2C398&amp;ssl=1 530w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>As always, post bugs or feature requests on the [github repo](https:\/\/github.com\/hrbrmstr\/cdcfluview) and drop a note here if you've found the package useful or have some other interesting views or analyses to share.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>**NOTE** If there&#8217;s a particular data set from http:\/\/www.cdc.gov\/flu\/weekly\/fluviewinteractive.htm that you want and that isn&#8217;t in the pacakge, please file it as an issue and be as specific as you can (screen shot if possible). &#8212;&#8211; Towards the end of 2014 I had been tinkering with flu data from the [CDC&#8217;s FluView portal](http:\/\/gis.cdc.gov\/grasp\/fluview\/fluportaldashboard.html) since flu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[673,674,722,91],"tags":[810],"class_list":["post-3215","post","type-post","status-publish","format-standard","hentry","category-datavis-2","category-dataviz","category-flu","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#039;s FluView Portal - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#039;s FluView Portal - rud.is\" \/>\n<meta property=\"og:description\" content=\"**NOTE** If there&#8217;s a particular data set from http:\/\/www.cdc.gov\/flu\/weekly\/fluviewinteractive.htm that you want and that isn&#8217;t in the pacakge, please file it as an issue and be as specific as you can (screen shot if possible). &#8212;&#8211; Towards the end of 2014 I had been tinkering with flu data from the [CDC&#8217;s FluView portal](http:\/\/gis.cdc.gov\/grasp\/fluview\/fluportaldashboard.html) since flu [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-11T02:12:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:44:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#8217;s FluView Portal\",\"datePublished\":\"2015-01-11T02:12:26+00:00\",\"dateModified\":\"2018-03-07T21:44:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/\"},\"wordCount\":475,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/flureport.png\",\"keywords\":[\"post\"],\"articleSection\":[\"DataVis\",\"DataViz\",\"Flu\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/\",\"name\":\"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC's FluView Portal - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/flureport.png\",\"datePublished\":\"2015-01-11T02:12:26+00:00\",\"dateModified\":\"2018-03-07T21:44:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/flureport.png?fit=600%2C700&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/flureport.png?fit=600%2C700&ssl=1\",\"width\":600,\"height\":700},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/01\\\/10\\\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#8217;s FluView Portal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC's FluView Portal - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/","og_locale":"en_US","og_type":"article","og_title":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC's FluView Portal - rud.is","og_description":"**NOTE** If there&#8217;s a particular data set from http:\/\/www.cdc.gov\/flu\/weekly\/fluviewinteractive.htm that you want and that isn&#8217;t in the pacakge, please file it as an issue and be as specific as you can (screen shot if possible). &#8212;&#8211; Towards the end of 2014 I had been tinkering with flu data from the [CDC&#8217;s FluView portal](http:\/\/gis.cdc.gov\/grasp\/fluview\/fluportaldashboard.html) since flu [&hellip;]","og_url":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/","og_site_name":"rud.is","article_published_time":"2015-01-11T02:12:26+00:00","article_modified_time":"2018-03-07T21:44:05+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#8217;s FluView Portal","datePublished":"2015-01-11T02:12:26+00:00","dateModified":"2018-03-07T21:44:05+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/"},"wordCount":475,"commentCount":9,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png","keywords":["post"],"articleSection":["DataVis","DataViz","Flu","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/","url":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/","name":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC's FluView Portal - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png","datePublished":"2015-01-11T02:12:26+00:00","dateModified":"2018-03-07T21:44:05+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?fit=600%2C700&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/01\/flureport.png?fit=600%2C700&ssl=1","width":600,"height":700},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"New R Package: cdcfluview \u2014 Retrieve Flu Data from CDC&#8217;s FluView Portal"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-PR","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3610,"url":"https:\/\/rud.is\/b\/2015\/08\/09\/cdcfluview-on-the-way-to-cran-7k\/","url_meta":{"origin":3215,"position":0},"title":"cdcfluview &#8211; On The Way to &#8220;CRAN 7K&#8221;","author":"hrbrmstr","date":"2015-08-09","format":false,"excerpt":"I like to turn coincidence into convergence whenever possible. This weekend, a user of [cdcfluview](http:\/\/github.com\/hrbrmstr\/cdcfluview) had a question that caused me to notice a difference in behaviour between the package was interacting with CDC FluView API, so I updated the package to accommodate the change and the user. Around the\u2026","rel":"","context":"In &quot;Data Analysis&quot;","block_context":{"text":"Data Analysis","link":"https:\/\/rud.is\/b\/category\/data-analysis-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3262,"url":"https:\/\/rud.is\/b\/2015\/02\/04\/a-step-to-the-right-in-r-assignments\/","url_meta":{"origin":3215,"position":1},"title":"A Step to the Right in R Assignments","author":"hrbrmstr","date":"2015-02-04","format":false,"excerpt":"I received an out-of-band question on the use of `%%` in my [CDC FluView](rud.is\/b\/2015\/01\/10\/new-r-package-cdcfluview-retrieve-flu-data-from-cdcs-fluview-portal\/) post, and took the opportunity to address it in a broader, public fashion. Anyone using R knows that the two most common methods of assignment are the venerable (and sensible) left arrow `` RHS assignment operator.\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/rud.is\/b\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7020,"url":"https:\/\/rud.is\/b\/2017\/11\/06\/taking-a-shot-at-cdcfluview-v0-7-0-a-k-a-the-dangers-of-relying-on-hidden-apis\/","url_meta":{"origin":3215,"position":2},"title":"Taking a Shot at cdcfluview v0.7.0 (a.k.a. The Dangers of Relying on &#8216;Hidden&#8217; APIs)","author":"hrbrmstr","date":"2017-11-06","format":false,"excerpt":"Unlike @noamross, I am not an epidemiologist (NOTE: Noam battles pandemics before breakfast, so be super nice to him) but I do like to find kindred methodologies in other disciplines to help foster the growth of cybersecurity into something beyond it's current Barnum & Bailey state. I also love finding\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-5-4.png?fit=672%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-5-4.png?fit=672%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-5-4.png?fit=672%2C480&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":12735,"url":"https:\/\/rud.is\/b\/2020\/04\/11\/new-package-cdccovidview-to-work-with-the-u-s-cdcs-new-covid-19-trackers-covidview-and-covid-net\/","url_meta":{"origin":3215,"position":3},"title":"New Package \u2014\u00a0{cdccovidview} \u2014 To Work with the U.S. CDC&#8217;s New COVID-19 Trackers: COVIDView and COVID-NET","author":"hrbrmstr","date":"2020-04-11","format":false,"excerpt":"The United States Centers for Disease Control (CDC from now on) has setup two new public surveillance resources for COVID-19. Together, COVIDView and COVID-NET provide similar weekly surveillance data as FluView does for influenza-like illnesses (ILI). The COVIDView resources are HTML tables (O_O) and, while the COVID-NET interface provides a\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4805,"url":"https:\/\/rud.is\/b\/2017\/01\/02\/removing-personal-bias-from-flu-severity-estimation-a-k-a-misery-loves-data\/","url_meta":{"origin":3215,"position":4},"title":"Removing Personal Bias From Flu Severity Estimation (a.k.a. Misery Loves Data)","author":"hrbrmstr","date":"2017-01-02","format":false,"excerpt":"The family got hit pretty hard with the flu right as the Christmas festivities started and we were all pretty much bed-ridden zombies up until today (2017-01-02). When in the throes of a very bad ILI it's easy to imagine that you're a victim of a severe outbreak, especially with\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/Cursor_and___Development_cdcfluview_-_master_-_RStudio-1.png?fit=1200%2C610&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/Cursor_and___Development_cdcfluview_-_master_-_RStudio-1.png?fit=1200%2C610&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/Cursor_and___Development_cdcfluview_-_master_-_RStudio-1.png?fit=1200%2C610&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/Cursor_and___Development_cdcfluview_-_master_-_RStudio-1.png?fit=1200%2C610&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/Cursor_and___Development_cdcfluview_-_master_-_RStudio-1.png?fit=1200%2C610&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3455,"url":"https:\/\/rud.is\/b\/2015\/06\/07\/animated-us-hexbin-map-of-the-avian-flu-outbreak\/","url_meta":{"origin":3215,"position":5},"title":"Animated US Hexbin Map of the Avian Flu Outbreak","author":"hrbrmstr","date":"2015-06-07","format":false,"excerpt":"The recent announcement of the [start of egg rationing in the U.S.](http:\/\/www.washingtonpost.com\/blogs\/wonkblog\/wp\/2015\/06\/05\/the-largest-grocer-in-the-texas-is-now-rationing-eggs\/) made me curious enough about the avian flu outbreak to try to dig into the numbers a bit. I finally stumbled upon a [USDA site](http:\/\/www.aphis.usda.gov\/wps\/portal\/aphis\/ourfocus\/animalhealth\/sa_animal_disease_information\/sa_avian_health\/sa_detections_by_states\/ct_ai_pacific_flyway\/!ut\/p\/a1\/lVPBkqIwEP2WOexpCxMBAY-oo6Kybo01q3JJNSGB1GCgSNTi7zcwe3CnZnQ3h1Sl-3X369cdlKADSiRcRA5aVBLK7p14ZLVd2sMJtqPFbvyMox-_5nGw8Z3t0jWAowHgL06I_47friOvi3_Bk-VsiHcO2qMEJVTqWhfoCHUhFKGV1ExqUoq0gab9hhWQ6twQXtGz6l8gxQlKUjAodXFryYRioBgRklfNqW_i3X0RIG_xGdOMdm5F0pYoDZqZ1FQTEKQGKrighJftFdqOX01Fho7c9iiAzS3HG6WWm2HbSnmAzYXxyA3AG1L-R487Df-TntNFuHT9jVHQDWwczUywP44xjrxH8b2eDzL0gHsj-1Bk8TwxReabn_56ZeP1CB0NSf9LFmMX7f5TtdXDtmYoib9z5YadQnYTT-PcVABdWN2s0eHuDry7b3agN3y2A-jw6Q4YfnlZpeZD7Ke3REKZOoEh0jDOGtYMikppdLher4OzymCQVxdUn15PgdMK6-0lwM7obR9ayTx_evoNPxBrVg!!\/?1dmy&urile=wcm:path:\/APHIS_Content_Library\/SA_Our_Focus\/SA_Animal_Health\/SA_Animal_Disease_Information\/SA_Avian_Health\/SA_Detections_by_States\/) that had an embedded HTML table of flock outbreak statistics by state, county\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=3215"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3215\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}