ISoP ISoP on Twitter | ACoP ACoP on Twitter | PAGE | WCoP | PAGANZ | PAGJa

ISoP Webinar: ggplotwithyourdata - an R Shiny app that facilitates Data Exploration and Summarization


The goals of developing this Shiny application, ggplotwithyourdata, were the following:

  1. to develop an application that enables non-R users to manipulate their data and to produce rich informative graphics and tables using modern R packages such as ggplot2, dplyr and table1.
  2. to provide a reference application that illustrates the interactive elements required for future applications/communication in our field.
  3. to provide a tool that facilitates ggplot2 learning.

Since the ISOP Tutorial on Shiny The shiny application framework has gained a widespread popularity in our field. Empowering non-R users is advantageous to both the R programmer and to the decision maker since it can cut the back and forth and review cycles.
The dplyr/tidyr R libraries are used to automatically reshape the data into a ggplot2 friendly format and to provide basic data manipulation capabilities such as filtering, recoding a continuous variable into categorical, and splitting into bins/groups with appropriate reordering.
To create the plots the ggplot2 library is used with the possibility to add smoother lines, median, mean, prediction intervals, Kaplan-Meier curves, boxplots, barplots, density and histograms. The ggplot2 framework naturally enables to add a group variable (separate summary (line) by group in the same figure or panel), a colour or fill variable as well as “faceting” which is splitting the plot into several subplots with a subset of the data in each.

The UI inputs translate into appropriate R code behind the scenes and no knowledge of ggplot2 or dplyr syntax is assumed. A minimal knowledge of ggplot2 jargon is a plus. To help users learn ggplot2 syntax there is a tab that output the Plot Code that the user can copy and paste into R after exporting the plot data. Extensive options for plots saving and exporting are available in the Export Plots tab.

The app also provides the possibility to quickly generate html Descriptive Stats table using table1 which support summarizing continuous and factor variables, split by one or two levels of variables.
The resulting application allows users to quickly and easily create professional quality plots. Key components of the data analysis workflow, including data input, manipulation and visualization will be demoed. The code is open sourced on GitHub to allow others to leverage those components in future apps. The app was deployed using ISOP shiny account where it can be accessed. Furthermore, a graphical front-end also enables the R experienced to more rapidly test and generate a list of potential useful graphs that later on can be fine-tuned to presentation quality. Having a handy, free, open source graphs/table generation tool is helpful to non-R and R users alike.

Throughout the lifetime of this app, the following persons were key contributors: @SamerMOUKSASSI, @dpastoor, Dean Attali, Ben Rich. We hope that the contributors list will grow up by submitting pull requests and by making the app even more useful to the community.