1.11.18

Intro

Flexdashboard is a package out of RStudio that allows users to easily create interactive visualizations to aid in communicating analysis results.

  • Data provides the most value to any organization when actionable items are identified
  • Dashboards are an effective means for technical or non-technical end users to view data
  • htmlwidgets provide a level of interactivity without requiring the dashboard to be hosted online
  • What may be lost not having the dash on a shiny server can often be made up utilizing the crosstalk package
    • Possible future presentation

Zaco

The greatest pizza/taco restaurant this country may never know

Zaco

Getting Started

Install the flexdashboard package from CRAN

install.packages("flexdashboard")

Getting Started

Install the flexdashboard package from CRAN

install.packages("flexdashboard")

To author a flexdashboard you can create an R Markdown document with the flexdashboard::flex_dashboard output format to begin with a template.

Getting Started

Install the flexdashboard package from CRAN

install.packages("flexdashboard")

To author a flexdashboard you can create an R Markdown document with the flexdashboard::flex_dashboard output format to begin with a template.

You can also create a general R Markdown document and set the output option:

output: flexdashboard::flex_dashboard

The Look

Designing the dashboard

Dashboards are divided into columns and rows with each of the output components indicated using the Level 3 Markdown header ###.

1 Column Layout with 2 charts:

Designing the dashboard

To include multiple of the same orientation (default = columns), include a Level 2 Markdown header ————–.

Change to 2 columns with the second having 2 charts

Designing the dashboard

To change the orientation to row-wise, specify the option:

output: 
  flexdashboard::flex_dashboard:
    orientation: rows

Zaco's Layout

The Data

Components of the dashboard

The dashboard can include numerous means to presenting data or commentary

  • Interactive JavaScript data visualizations based on htmlwidgets
  • R graphical output including base, lattice, and grid graphics
  • Tabular data (with optional sorting, filtering, and paging)
  • Value boxes for highlighting important summary data
  • Gauges for displaying values on a meter within a specified range
  • Text annotations
    • uses rmarkdown syntax

htmlwidgets

For each chart, utilize htmlwidgets for the end user to have interactive capability.

Some of my go-tos:

DT

datatable(iris)

Zaco's Layout

htmlwidgets

plotly

plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length) %>% 
  add_markers(color = ~Species)

ggplotly

gg <- ggplot(mpg, aes(displ, hwy)) + geom_point() + 
  stat_smooth()
ggplotly(gg)

Zaco's Layout

htmlwidgets

leaflet

leaflet() %>% addProviderTiles(providers$OpenStreetMap) %>%
addMarkers(lng=-83.744798 , lat=42.279238, popup="This Is Us")

Zaco's Layout

htmlwidgets

crosstalk

Zaco's Layout

Questions?