Why bother?

Why should you DLAB?

  • Pretty!

  • Organized

  • Interactive

  • Reproducible

  • Free

  • You get to use R

  • Flexible

  • Better visualizations (sorry gg)

  • People will respect you

How to DLAB?

A 12 Step Program to Quit Emailing Plots & Csvs

How to DLAB?

A 12 Step Program to Quit Emailing Plots & Csvs

  1. Basic Layout
  2. Printing: Tables,Descriptice Stats, Model summaries
  3. Interactive Datasets
  4. Interactive Plots
  5. Exporting
  6. CSS basics
  7. Branding (Logos, font, colors)
  8. Header/Footer
  9. Hosting
  10. Automate-ish (render + system())
  11. Replicate (render with arguments)
  12. Automate or App it (cron, shiny runtime)

How to DLAB?

A 12 Step Program to Quit Emailing Plots & Csvs

1. Basic Layout
2. Printing: Tables, Descriptice Stats, Model summaries
3. Interactive Datasets
4. Interactive Plots
5. Exporting

1. Basic Layout

<3 flexdashboard <3

.Rmd + flexdashboard

Before :(

After :)

flexdashboard layouts

My go-to

optional:

  • vertical_layout: {scroll, fill}

  • orientation: {columns, rows}

print() is simply unacceptable

2. Printing Tables, Descriptive Stats & Model Summaries

Tables, Descriptive Stats & Model Summaries

printr

summarytools::dfSummary

stargazer::stargazer

Table Printing: my go-to



tables & descriptive stats: printr



model summaries: stargazer::stargazer


Model Summary & Comparisons

stargazer::stargazer

3. Interactive Datasets

Interactive Datasets

DT::datatable

Datasets

DT::datatable

  • pretty printing

  • flexible formatting

  • column filtering

  • csv download

  • cell highlighting (think heatmap)

4. Interactive plots

We're not in PowerPoint anymore.

4. Interactive plots

highcharter






ggplot2 will always have a place in your heart, but dashboards need more than pngs

4. Interactive plots

highcharter







Other options

  • Maps:                              leaflet
  • Timeseries:                     dygraphs
  • ggplot2 compatible:      plotly

4. Exporting

Exporting

  • Datasets with DT

  • Highcharter Plots

Dashboard LIKE A BOSS: pro tips

Let your dashboard work for you

SIMPLE

  • Start with a simple template & someone else's css
  • Add in the essentials or the lowest hanging fruit as you go

ORGANIZED

  • Maintain a folder containing: css, exporting scripts, color palletes, global themes, & templates
  • Keep a staging folder for exploration–don't make changes you won't know how to undo.
  • Keep expensive data cleaning in a separate script (easier to introduce it later than remove it after)

EXPLORE

  • Try something new (template, plots, or css) to improve the appearance & usability of each new dashboard
  • Slowly work in: About page & explanations, interactive viz, exporting, logo, footer, padding/margins

Resources

github.com/maloriejhughes

  1. Basic Layout:
  2. Interactive Viz:
  3. Data/Tables
  4. Models
  5. Exporting Data & Plots
    • highcharter
    • custom script
  6. CSS (global settings: themes, layout, background, etc)
  7. html ( in-line style/text changes, images, hyperlinks, web basics )
  8. Branding ( css+html: custom fonts, global color themes, watermarks, etc)
  9. Hosting
  10. Automate-ish (render + system())
  11. Replicate (render with arguments)
  12. Automate or App it (cron, shiny runtime)