Making Custom Web-Based Data Visualizations with Free R Packages
The tools presented here require you to code using the R statistical programming language. Although you may not have much fun coding things up yourself, with these packages and tools, you can create results that are more customized for your needs. You can use Shiny, rCharts, and rMaps to create really neat looking web-based data visualizations.
Getting Shiny by RStudio
Of course, if you wanted to do both simultaneously, then you’d have to know how to code in an additional two or three more programming languages. In other words, web-based data visualization based on statistical analyses was a cumbersome task.
The good news is that things have changed. Due to the work of a few dedicated developers, the walls between analysis and presentation have crumbled. After the 2012 launch of RStudio’s Shiny package, both statistical analysis and web-based data visualization can be carried out in the same framework.
RStudio — already, by far, the most popular integrated development environment (IDE) for R — developed the Shiny package to allow R users to create web apps. Web apps made in Shiny run on a web server and are interactive — with them, you can interact with the data visualization to move sliders, select check boxes, or click the data itself.
Because these apps run on a server, they’re considered live — when you make changes to the underlying data, those changes are automatically reflected in the appearance of the data visualization. Web apps created in Shiny are also reactive — in other words, their output updates instantly in response to a user interaction, without the user having to click a Submit button.
Because Shiny produces server-side web apps, you need a server host and the know-how to host your web app on a server before you can make useful web apps by using the package.
Shiny runs a public web server called ShinyApps.io.You can use that server to host an app for free, or you can pay to host there if your requirements are more resource-intensive. The most basic level of service costs $39 per month and promises you 250 hours of application run time per month.
Charting with rCharts
Although R has always been famous for its beautiful static visualizations, only just recently has it been possible to use R to produce web-based interactive data visualizations.
To see some examples of data visualizations created by using rCharts, check out the rCharts Gallery. This gallery includes simple data graphics such as standard bar charts and scatterplots, as well as more complex data graphics such as chord diagrams and hive plots.
Mapping with rMaps
rMaps allows you to create a spatial data visualization that contains interactive sliders that users can move to select the data range they want to see.
If you’re an R user and you’re accustomed to using the simple R Markdown syntax to create web pages, you’ll be happy to know that you can easily embed both rCharts and rMaps in R Markdown.
The Plotly tool has a Python application programming interface (API) — as well as ones for R, MATLAB, and Julia — that you can use to create web-based interactive visualizations directly from your Python IDE or command line. (Check out Flask, Bokeh, Mpld3, and Plotly.)