25 February 2020

Slides: https://alice-hannah.github.io/presentations-and-blogs/2020-02-25_flexdashboard/slides.html

Background and Motivation

  • Quarterly management reports for Dementia Post Diagnostic Support (PDS) data

  • SPSS used for data preparation and calculating performance measures

  • Excel used to present data

  • New data recording guidance prompted review of methodology and presentation of management reports

Why flexdashboard?

  • Process can be automated using R and R Markdown

  • Output can include interactive elements

  • Output as a stand alone html file

    • Universal file format
    • No requirement for password protected shiny server
    • Can continue to be distributed via email to restrict access
  • Looks swish!

Using flexdashboard

Define output as flexdashboard in YAML header of R Markdown document:

---
title: "Dementia PDS Quarterly Management Report"
output: 
  flexdashboard::flex_dashboard:
    navbar:
      - title: "Data as at 31 December 2019"
    logo: isdscotland.png
    orientation: rows
    vertical_layout: scroll
---

Using flexdashboard

Add a new row…

Row
-------------------------------------------------

Add multiple pages…

Home
=================================================

Create a tabset to switch between sections…

Row {.tabset}
-------------------------------------------------

Using flexdashboard

flexdashboard::valueBox(paste0(80, "%"), 
                        icon = "fa-percent",
                        caption = paste("of people estimated to be newly",
                                        " diagnosed with dementia were referred",
                                        " for post-diagnostic support.")
)

R Markdown Child Templates

  • Used to create multiple pages with the same layout for each financial year and health board, thus avoiding duplication of code

  • Write separate R Markdown document called a “child” template

  • Use knitr::knit_child() in the main markdown document to knit the “child” template for each combination of parameters

  • Tutorial to use R Markdown Childs with flexdashboard

Next Steps

  • Automate date in navbar so dashboard is fully automated

  • Improve comments/documentation of code

  • Develop further data analysis

  • Develop as shiny dashboard when infrastructure available

Contact & Links