Blog Archives

A Step to the Right in R Assignments

February 4, 2015
By

I received an out-of-band question on the use of %<>% in my CDC FluView 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 <- and it’s lesser cousin =. <- has an

Read more »

New release (0.7) of metricsgraphics htmlwidget — grids & rollovers

February 1, 2015
By

I’ve updated my metricsgraphics package to version 0.7. The core MetricsGraphics JavaScript library has been updated to version 2.1.0 (from 1.1.0). Two blog-worthy features since releasing version 0.5 are mjs_grid (which is a grid.arrange-like equivalent for metricsgraphics plots and mjs_add_rollover which lets you add your own custom rollover text to the plots. The Grid The

Read more »

NASA GISS’s Annual Global Temperature Anomaly Trends (dplyr/ggplot version)

January 18, 2015
By
NASA GISS’s Annual Global Temperature Anomaly Trends (dplyr/ggplot version)

D Kelly O’Day did a great post on charting NASA’s Goddard Institute for Space Studies (GISS) temperature anomaly data, but it sticks with base R for data munging & plotting. While there’s absolutely nothing wrong with base R operations, I thought a modern take on the chart using dplyr, magrittr & tidyr for data manipulation

Read more »

New R Package: cdcfluview — Retrieve Flu Data from CDC’s FluView Portal

January 10, 2015
By
New R Package: cdcfluview — Retrieve Flu Data from CDC’s FluView Portal

Towards the end of 2014 I had been tinkering with flu data from the CDC’s FluView portal since flu reports began to look like this season was going to go the way of 2009. While you can track the flu over at The Washington Post, I like to work with data on my own. However

Read more »

New R Package: metricsgraphics

January 8, 2015
By
2015-01-09 20_12_42-Clipboard

Mozilla released the MetricsGraphics.js library back in November of 2014 (gh repo) and was greeted with great fanfare. It’s primary focus is on crisp, clean layouts for interactive time-series data, but they have support for other chart types as well (though said support is far from comprehensive). I had been pondering building an R package

Read more »

Making Static & Interactive Maps With ggvis (+ using ggvis maps w/shiny)

December 29, 2014
By
Making Static & Interactive Maps With ggvis (+ using ggvis maps w/shiny)

Even though it’s still at version 0.4, the ggvis package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of ggvis for presenting static &

Read more »

Power Outage Impact Choropleths In 5 Steps in R (featuring rvest & RStudio “Projects”)

November 27, 2014
By
Power Outage Impact Choropleths In 5 Steps in R (featuring rvest & RStudio “Projects”)

I and @awpiii were trading news about the power outages in Maine & New Hampshire last night and he tweeted the link to the @PSNH Outage Map. As if the Bing Maps tiles weren’t bad enough, the use of a categorical color scale instead of a sequential one caused sufficient angst that I whipped up

Read more »

Visualizing Historical & Most-likely First Snowfall Dates for U.S. Regions

November 26, 2014
By
Visualizing Historical & Most-likely First Snowfall Dates for U.S. Regions

UPDATE: You can now run this as a local Shiny app by entering shiny::runGist("95ec24c1b0cb433a76a5", launch.browser=TRUE) at an R prompt (provided all the dependent libraries (below) are installed) or use it interactively over at Shiny Apps. The impending arrival of the first real snowfall of the year in my part of Maine got me curious about

Read more »

Moving The Earth (well, Alaska & Hawaii) With R

November 16, 2014
By
Moving The Earth (well, Alaska & Hawaii) With R

In a previous post we looked at how to use D3 TopoJSON files with R and make some very D3-esque maps. I mentioned that one thing missing was moving Alaska & Hawaii a bit closer to the continental United States and this post shows you how to do that. The D3 folks have it easy.

Read more »

Spending Seized Assets – A State-by-State Per-capita Comparison in R

October 13, 2014
By
Spending Seized Assets – A State-by-State Per-capita Comparison in R

The Washingon Post did another great story+vis, this time on states Spending seized assets. According to their sub-head: Since 2008, about 5,400 police agencies have spent $2.5 billion in proceeds from cash and property seized under federal civil forfeiture laws. Police suspected the assets were linked to crime, although in 81 percent of cases no

Read more »