Subscribe to DSC Newsletter

This is a tutorial to show how to implement dashboards in R, using the new "flexdashboard" library package.

this new library leverages these libraries and allows us to create some stunning dashboards, using interactive graphs and text. What I loved the most, was the “storyboard” feature that allows me to present content in Tableau-style frames. Please note that for this you need to create RMarkdown (.Rmd) files and insert the code using the R chunks as needed.

Storyboard format allows you to logically move the audience through the analysis : problem statement, raw data and exploration, different parts of the models/simulations/ number crunching, patterns in data, final summary and recommendations. Presenting the patterns that allow you to accept or reject a hypothesis has never been easier.

Storyboard Dashboard:

Instead of analyzing a single dataset, I have chosen to present different interactive graph types using the storyboard feature. This will allow you to experience the range of options possible with this package.

An image of the storyboard is shown below, but you can also view the live document here (without source code or data files) .  The complete data and source code files are available for download here, under May 2017 on the Projects page.

The storyboard elements are described below:

  • Element 1 – Click on each frame to see the graph and explanation associated with that story point. (click element 5 to see Facebook stock trends)
  • Element 2 – This is the location for your graphs, tables, etc. One below each story point.
  • Element 3 – This explanation column in the right can be omitted, if required. However, my personal opinion is that this is a good way to highlight certain facts about the graph or place instructions, hyperlinks, etc. Like a webpage sidebar.
  • Element 4 – My tutorial only has 4 story elements, but if you have more flexdashboard automatically provides left-right arrow for navigation. (Just like Tableau).
  • Element 6 – Title bar for the project. Notice the social sharing button on the far right.

 

Story Points:

The different frames in the storyboard showcase different packages supported by R, for creating beautiful visuals.

  • Dygraphs - shows Facebook stock data, with an interactive slider to select dates of interest. Uses the "quantmod" package to pull in latest Facebook stock prices from Yahoo! Finance.
  • Plotly - Data rich graphs which allows you to zoom in or out. Values are shown on mouse hover.
  • d3heatmap - Interactive heatmaps. You can highlight specific rows or columns by clicking on the row / column names.

 

Hope you found these implementations. Please do add your valuable feedback and inputs in the comments section.

Until next time, happy coding! :) 

Views: 6171

Comment

You need to be a member of Data Science Central to add comments!

Join Data Science Central

Comment by Georgi D. Gospodinov on Saturday
Very cool. Question: does this, along with the other visualization tools mention below, offer the ability to input data as well, update parameters? Is this a substitute to Rshiny in functionalitynor mostly a flexible dashboarding tool?
Comment by Anupama Rajaram on May 30, 2017 at 1:31pm

Update: the "getSymbols' in the Quantmod package no longer works as Yahoo! APIs have been discontinued. However, you can extract similar data using the "Quandl" package and API keys.

Comment by Anupama Rajaram on May 20, 2017 at 6:17pm
Igor, glad you liked my project!
Comment by Anupama Rajaram on May 20, 2017 at 6:17pm
Matt, I totally agree that plotly is a powerful tool. So it is a great advantage that this new library package (flexdashboard) allows coders to integrate the plotly graphs as storypoints.
Comment by Anupama Rajaram on May 20, 2017 at 6:14pm
Thank you Gauav, for the info. DisplayR looks interesting, although it is only free for a limited period.
Comment by Igor Misechko on May 20, 2017 at 4:02pm

Thank you!

Very interesting example of dashboard.

Comment by Matt Sandy on May 18, 2017 at 6:08pm

Plotly also allows for linked plots which is a powerful tool for creating dashboards. 

Comment by Gauav Jain on May 17, 2017 at 8:58pm

 Great post on dashboards in R. There is also a great (free) software called Displayr that allows you to make killer dashboards in R. Check it out https://www.displayr.com/introduction-to-displayr-1-overview/ 

Follow Us

Videos

  • Add Videos
  • View All

Resources

© 2017   Data Science Central   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service