Adding a dash of interactivity with Plotly
There is an open source JavaScript library for data visualization, which is declarative, high-level, and allows you to create dozens of types of interactive graphs called Plotly.js. This library is the core of other Plotly client libraries, developed for Python, Scala, R, and ggplot. In particular, the library developed for R, called Plotly.R (https://github.com/ropensci/plotly), provides the ggplotly()
function, which does all the magic for us: it detects all the basic attributes contained in an existing graph developed with ggplot and transforms it into an interactive web visualization. Let’s see an example.
First, you need to install the Plotly.R library (https://github.com/ropensci/plotly) on your latest CRAN R engine using the install.packages('plotly')
script.
IMPORTANT NOTE
For simplicity, we’ll make sure to run the custom visual on the latest version of the CRAN R engine, since all the...