htmlwidgets: Create interactive web charts in R

Posted to Software  |  Tags: ,  |  Nathan Yau

If you don’t want to bother with JavaScript but want to publish interactive graphics for the web or use interaction to explore your data, htmlwidgets might be for you.

HTML widgets work just like R plots except they produce interactive web visualizations. A line or two of R code is all it takes to produce a D3 graphic or Leaflet map. HTML widgets can be used at the R console as well as embedded in R Markdown reports and Shiny web applications.

Use existing widgets that let you visualize with popular JavaScript libraries such as D3 or Leaflet. Or, create your own.

Favorites

How You Will Die

So far we’ve seen when you will die and how other people tend to die. Now let’s put the two together to see how and when you will die, given your sex, race, and age.

Who is Older and Younger than You

Here’s a chart to show you how long you have until you start to feel your age.

Shifting Incomes for American Jobs

For various occupations, the difference between the person who makes the most and the one who makes the least can be significant.

Life expectancy changes

The data goes back to 1960 and up to the most current estimates for 2009. Each line represents a country.