Building a Dashboard with R Shiny

Contents
  1. Introduction
    1. What is R Shiny?
    2. Implementation Requirements
    3. Strengths and Weaknesses
  2. Getting Started
    1. Resources and Learning Material
    2. Basic Tutorial
  3. Advanced Resources

Introduction

What is R Shiny?

R is a scripting language and analysis software used globally by researchers and data scientists for statistical computing and data analysis. It is open source and proposes a large set of libraries to achieve a range of analysis, data manipulation and visualisation.

Shiny is a library for R, allowing a developer to create a dahsboard with interactive graphs, by writing R code only. No knowledge of website development languages (HTML, CSS and JS) is required. If the developer has knowledge of these basic web development languages, it is possible to integrate custom scripts and stylesheets to a Shiny dashboard to create a more complex and customisable website.

Implementation Requirements

Technical skills:

  • Fundamental:
    • Knowledge of R
  • Beneficial:
    • Understanding of basic web languages and website structure
    • Knowledge of HTML and CSS for visual design
    • Knowledge of JS for more advanced custom UI features

Infrastructure:

  • Any computer where you can install R
  • A version control workflow (e.g., git) is very helpful and highly recommended, especially for collaborative projects
  • TODO: add info on servers, deployment, etc…

Strengths and Weaknesses

Strengths:

  • A single person with some R knowledge can easily create a dashboard from scratch
  • Seamless integration to the data flow (data cleaning, manipulation, analyses, visualisation)
  • Access to the whole set of R libraries for data manipulation, analysis and visualisation
  • Very modular - possibility to add blocks of text or graphs in almost any layout you want.
  • Good visual theming options
  • Possibility to integrate CSS, JS, custom HTML templates, CSS pre-processors, etc…

Weaknesses:

  • The code behind complex dashboards can become quite intricate
  • Advanced customisation of visual design and page layout requires good knowledge of HTML and CSS

Getting Started

Resources and Learning Material

It is possible to start making Shiny dashboard with entry- to intermediate-level R skills.

The 2.5H video tutorial on R Shiny’s main page is a very good start and will take you through the structure of Shiny apps, the basics of layout and all reactivity functions.

To go further, the Articles page on R Shiny’s main page has detailed information on performance optimisation, UI and integration of HTML, CSS and JS.

Eventually, making better dashboards will mean improving the delivery of information to the user through clearer content, better content flow and better UI and UX design.

Basic Tutorial

TODO: folder and file structure, navigation and layout options, tips and tricks…

Advanced Resources

TODO: integration of CSS, SCSS, JS, troubleshooting…


Back to top

OHEJP logo
This website is part of the European Joint Programme One Health EJP.
This project has received funding from the European Union's Horizon 2020
research and innovation programme under Grant Agreement No 773830.