Metrum Minutes

ggedit 0.1.1: Shiny module to interactvely edit ggplots within Shiny applications

by Jonathan Sidi

ggedit is a package that lets users interactively edit ggplot layer and theme aesthetics. In a previous post, we showed you how to use it in a collaborative workflow using standard R scripts. More importantly we highlighted that ggedit outputs to he user, after editing, with updated ggplots, layers, scales, and themes as both self-contained objects and scripts that you can paste directly in your code.

This post will demonstrate a new method to use ggedit, Shiny modules.


Data Driven Cheatsheets

by Jonathan Sidi

Cheatsheets are currently built and used exclusively as a teaching tool. But what if we could produce a cheatsheet that provides a roadmap to build a previously defined product? We could also build the cheatsheet as a function so users can input data into it in order to customize it. This provides a consistent format that people can share with each other, and it has the added value of conveying a message through data driven visual changes.


ggedit RStudio::conf 2017 Presentation

by Jonathan Sidi

On January 15 the updated version of ggedit was presented in RStudio::conf.

Highlights of the updated version.

  • verbose script handling during updating in the gagdet (see video below)
  • verbose script output for updated layers and theme to parse and evaluate in console or editor
  • output for scale objects eg scale*grandientn and scale*manual
  • verbose script output for scales eg scale*grandientn and scale*manual to parse and evaluate in console or editor
  • input plot objects can have the data in the layer object and in the base object.
    • ggplot(data=iris,aes(x=Sepal.Width,y=Sepal.Length,colour=Species))+geom_point()
    • ggplot(data=iris,aes(x=Sepal.Width,y=Sepal.Length))+geom_point(aes(colour=Species))
    • ggplot()+geom_point(data=iris,aes(x=Sepal.Width,y=Sepal.Length,colour=Species))
  • Visualizing theme objects in single output
  • Visual Comparison of two themes objects in single output


ggedit – Interactive ggplot Aesthetic and Theme Editor

by Jonathan Sidi

About ggedit

ggplot2 has become the standard of plotting in R for many users. New users, however, may find the learning curve steep at first, and more experienced users may find it challenging to keep track of all the options (especially in the theme!).

ggedit is a package that helps users bridge the gap between making a plot and getting all of those pesky plot aesthetics just right, all while keeping everything portable for further research and collaboration.

ggedit is powered by a Shiny gadget where the user inputs a ggplot plot object or a list of ggplot objects. You can run ggedit directly from the console or from the Addin menu within RStudio.


What's New at Metrum

Find out about Metrum at ACoP7, Metworx V3 and other news!


Reactive Shiny Filters Through Collapsible D3js Trees

by Jonathan Sidi

D3js is a great tool to visualize complex data in a dynamic way. But how can the visualization be part of the natural workflow?

Creating new reactive elements through the integration of Shiny with d3js objects allows us to solve this problem.

Through Shiny we let the server observe the d3 collapsible tree library and its real-time layout. The data transferred back to Shiny can be mapped to a series of logial expressions to create reactive filters. This allows for complex data structures, such as heirarchal simulations, complex design of clinical trials and results from polycompartmental structural models to be visually represented and filtered in a reactive manner through an intuitive and simple tool.


Metrum Research Group Announces New President

Metrum Research Group is pleased to announce the appointment of Bill Knebel, Pharm.D., Ph.D. as President of the biomedical modeling and simulation services firm.

Tariffville, CT: Over the last twelve years, Metrum has become a global leader in driving data informed decision-making throughout the biomedical research, development, and commercialization process. As the demand for these services and solutions increases, Metrum continues its commitment to delivering superior scientific expertise, the highest quality deliverables, and the growth of the discipline. Appointing Dr. Knebel as president will ensure these priorities are sustained. The skills of the president will be critical in managing operational effectiveness and technical expertise as the organization continues to evolve.

"I am confident that Bill's extensive expertise, leadership skills, and genuine enthusiasm for the work we do, will drive Metrum to continued excellence in execution of our mission", notes Marc Gastonguay, Metrum Research Group co-founder and CEO.

Dr. Knebel joined MetrumRG in 2004 and has been a valued team member over the last 12 years, most recently as Principal Scientist II and Group Leader of the Clinical Pharmacology Modeling and Simulation team. He brings nearly 20 years of experience in applying mathematical modeling and simulation techniques to optimize drug development across academic and industrial settings. Dr. Knebel has taken a leadership role in strengthening Metrum's capabilities and has been a champion of applying high-performance cloud computing environments to facilitate biomedical problem solving.

Metrum Research Group, established in 2004, is a global leader in biomedical modeling and simulation. The group of approximately 25 full time employees has provided strategic decision making for more than 100 companies on over 300 projects.

Practice of Bayesian Analysis

by Charles Margossian, B.Science, Pharmacometrics Bootcamp

Bayesian analysis is a powerful method for model-based data analysis. In pharmacometrics, we use such models to predict drug effects and recommend targeted and cost-effective clinical trials. One of the main strengths of Bayesian analysis is that it allows statisticians to quantitatively integrate data and prior information such as data from other studies. This proves key when constructing sophisticated models for which data from a single trial may be sparse or incomplete.

In this Journal Club, we discuss advantages of using Bayesian analysis, as well as malpractices thereof, historical criticisms, and modern approaches to address these criticisms. For the latter part, we closely follow the argument by Gelman & Shalizi 1.

Bayesian analysis has been central to some of our work at Metrum. Examples include the construction of a drug-disease-trial model describing Alzheimer’s progression in patients 2, and the development of a method to compare the efficacy of different drugs 3. The Metrum Institute has also posted free online courses on the application to Bayesian analysis to pharmacometrics.

To view this journal club session, please visit our YouTube channel here.

1 Andrew Gelman, Cosma Rohilla Shalizi. Philosophy and the practice of Bayesian statistics. British Journal of Mathematical and Statistical Psychology, 2013.

2 James A Rogers, Daniel Polhamus, William R Gillespie, Kaori Ito, Klaus Romero, Ruolun Qiu, Diane Stephenson, Marc R Gastonguay, and Brian Corrigan. Combining patient-level and summary-level data for alzheimer’s disease modeling and simulation: a beta regression meta-analysis. J Pharmacokinet Pharmacodyn, Jul 2012.

3 Jorge Luiz Gross, James Rogers, Daniel Polhamus, William Gillespie, Christian Friedrich, Yan Gong, Brigitta Ursula Monz, Sanjay Patel, Alexander Staab, and Silke Retlich. A novel model-based meta-analysis to indirectly estimate the comparative efficacy of two medications: an example using DPP-4 inhibitors, sitagliptin and linagliptin, in treatment of type 2 diabetes mellitus. BMJ Open, 3:e001844 (, 2013.