Bringing It All Together: From Data to Insights to Decisions
August 01, 2024
Motivation
The Importance of Context
Six General Principals
Choosing the Chart
Less is More
Hierarchy Among Data
Not All Data Are Equally Important
Telling Your Story
Dashboards
We have explored many implementation details in recent days, focusing on individual aspects of each analysis.
Today, we want to take a step back to think less about the detail and more about the process.
After all, every data analysis has a purpose. How can we achieve it more effectively?
Let’s break down the data communication process into six general principles:
Every analysis has a goal and an audience.
It’s important to separate data exploration from the final analysis. Don’t fall into the temptation of showing everything you did.
Adapt the report to your audience. Decision-makers aren’t always interested in execution details.
So what? Keep a specific learning objective in mind. It will guide which information is relevant for your report.
Isolated numbers don’t tell us much. To make evidence-based decisions, it’s necessary to establish an appropriate basis for comparison for the goal of your report.
What type of data?
How many dimensions?
Most reports are consumed in 2D media. Showing more than that can confuse the reader.
Be careful with scales!
The more information in your visualization, the greater the cognitive load.
Your objective must be to reduce your audience cognitive costs.
Data-Ink Ratio Formula
\[ \text{Data-Ink Ratio} = \frac{\text{Data-Ink}}{\text{Total ink used to print the graphic}} \]
Your objective must be to reduce your audience cognitive costs.
Let’s tell a story starting from the chart below, making step-by-step adaptations we’ve discussed. What is it telling you?
The goal of flexdashboard
is to facilitate the creation of interactive dashboards with R Markdown
.
Support for a wide variety of components, including htmlwidgets
; base graphics, structure, and grid; tabular data; gauges and value boxes; and text annotations.
Flexible and easy to specify layouts based on rows and columns. Components are intelligently resized to fill the browser and adapted for mobile display.
Storyboard layouts to present sequences of visualizations and related commentary.
After installing the package, to create a flexdashboard
simply open a new R Markdown
document with the output format flexdashboard::flex_dashboard
. You can do this from within RStudio using: File > New File > R Markdown...
:
Dashboards are divided into columns and rows, with output components delineated using level 3 markdown
headers (###
).
By default, dashboards are laid out in a single column, with charts stacked vertically and sized to fill the available height of the browser.
Depending on the nature of your dashboard (number of components, ideal component height, etc.), you might prefer a scrolling layout where components occupy their natural height and the browser scrolls when additional vertical space is needed.
You can specify this attribute via the vertical_layout: scroll
option.
orientation: rows
.Storyboards are an alternative to the row and column-based layout schemes.
They are suitable for presenting a sequence of data visualizations and related commentary.
To create a storyboard layout, add storyboard: true
to the dashboard’s preamble. This option includes a set of level 3 dashboard components (###
). Each component will receive its own frame in the storyboard, with the section title used as a navigation caption.
Main Takeaways from this lecture:
Data Communication Principles:
Visualization Best Practices:
Effective Dashboards:
flexdashboard
to create interactive layouts.Final Message:
Data Mining Lab