Fu-Sheng Chou, MD, PhD
History
The R statistical language has been around since 1995. Ross Ihaka and Robert Gentleman first developed it in 1991 at the University of Auckland in New Zealand. The project became publicized in 1993. R is open-source software under the GNU General Public License. This is probably why academicians and statisticians widely use R for data mining, analysis, and research communication. The powerful engine for graphics rendering in R distinguishes itself from other commonly used software packages such as Microsoft® Excel in data plotting and graphic annotation. The most recent stable update at the time of this article is version 4.0.3 and is available for download from multiple Comprehensive R Archive Network (CRAN) mirror sites. (1)
RStudio® was founded by J. J. Allaire in 2009, with a mission to create free and open-source software for data science, scientific research, and technical communication. As of 2019, RStudio® has become a Public Benefit Corporation. RStudio® produced its f irst integrative development environment (IDE) for R in 2011. The open-source edition of the RStudio IDE is licensed under AGPL v3 and is freely available to anyone. The most recent stable release of RStudio IDE at the time of this article is version 1.3. (2)
R packages
There are now over 16,000 packages for R that are freely available for download to facilitate specific areas of workflow, analysis, statistical modeling, plotting, and result distribution.(3) In addition to developing IDE, RStudio® is also heavily involved in R package development to improve user experience. One area of their focus is research communication. RStudio® has created three packages in this regard, namely, Shiny, rmarkdown, and f lexdashboard, all with a unifying mission to facilitate information distribution and communication.(4) Shiny and rmarkdown are two critical packages developed by RStudio® that were used to develop the new Neonatology Today website (or you can call it a web application, or a webApp). Shiny lets developers build webApps that are intrinsically interactive using R syntax.(5) These interactive Shiny webApps allow researchers to communicate the full spectrum of their results with the audience based on the audience’s input. On the other hand, rmarkdown allows the audience to generate final reports in a variety of formats (PDF, HTML, Word file, etc.).(6)
Structure of the Neonatology Today webApp
The new Neonatology Today webApp is built natively in R and Rstudio® IDE using the Shiny package and others. Figure 1 outlines the structure of the Neonatology Today webApp. The webApp consists of two parts: 1) content presentation and 2) user data entry, including the Online Manuscript Submission System and the Online Manuscript Review System. Notably, additional webApps were developed, allowing the management team to update the content and control the flow of the submitted manuscripts.
Content presentation
- The webApp allows the readers to access the journal content in both PDF or HTML formats. The PDFs are available for articles from January 2019 to current, and HTML formats are available for selected articles from July 2020. The webApp also contains a search function for articles in the HTML format. The search function provides a great example of the reactivity of a Shiny webApp.
- Besides journal articles, additional features were created to enrich reader experience, including a running Announcement carousel, an Events box, and a New & Views box accessible from the main page. The well-appreciated author artwork in the original PDF format is also available to the readers in a carousel, alongside the editors’ information.
- The front page is designed with mobile device access in mind. The content display should be equally visually satisfying when viewed using major mobile browsers on mobile devices.
Online Manuscript Submission System
- The Online Manuscript Submission System was developed with a goal in mind to allow authors to create, save, and submit manuscripts directly within the webApp. The interactive nature of webApps developed using the Shiny package made it an ideal tool for such tasks. With the combined use of the rmarkdown package, the authors can fully concentrate on their manuscripts’ content without the need to spend time typesetting their manuscripts before submission.
- Figures and tables to be uploaded to the Online Manuscript Submission System are preferably prepared in PDF format, a popular format built into modern operating systems (the Print as PDF function), making the conversion effortless. The PDFs store information such as text, font type, vectorized graphs, and pixelated images in one file. This is different from other manuscript submission systems, where different file formats are requested for different figure types, and image resolution was always a concern after image file type conversion.
- Before submission, the compiled manuscript and cover letter f iles are downloaded as PDFs thanks to the rmarkdown package for review. Once approved by the authors, the manuscript and the cover letter may be ready for submission.
- The Online Manuscript Submission System is available for public testing. Please note that we have discovered that it does not function properly in the Firefox browser.
Online Manuscript Review System
- Like the Online Manuscript Submission System, the Online Manuscript Review System allows the reviewers to interact with the webApp to enter their comments and feedback. The System will record the comments. Once the comments are submitted, the System will generate a certificate for the reviewer, thanks to the rmarkdown package.
With the abundant amount of available packages for developers to use “behind the scene,” the potential of a Shiny webApp is enormous. Imagine having a Shiny webApp with a user interface for parameter entry and a machine learning-based model on the server-side to calculate clinical outcome prediction. The machine learning-based model hiding in the background may have been developed natively in R using the famous ranger random forests modeling package. The newly entered parameter data is stored in a SQL database using the odbc package and is called periodically for use to re-train the model. The R statistical language does it all, seamlessly, using the same syntax. Most importantly, the syntax is intuitive to people like me who have no computer language experience and do not know how computers work inside metal cases.
In my opinion, simple Shiny webApps can be created for routine clinical data collection and reporting, standardized scoring system development, clinical protocol reminders, real-time quality improvement project reporting. A more sophisticated webApp can be created to guide the clinical decision, provided the background statistical model has a good predictive value. Shiny webApp developers may be concerned about HIPAA compliance, but there are ways to avoid violating the regulations. Data used for analysis in R are stored in the random-access memory (RAM), which means that, unless you ask R to write the data object into a file on a disk or a flash drive, the data will not be stored permanently. In other words, as long as the private health information is not directly written into a file, there should be minimal concerns for HIPAA violation. A local institutional review board should always be consulted to determine compliance at the institute level.
I would like to thank Dr. Goldstein again for creating this Data Science column for me to share my stories about learning coding in R and developing shiny webApps. Starting next month, I would like to introduce you to some simple R syntax and show you how to develop simple webApps that may assist you with some of your routine workflows in the NICU. I plan to show you how to create a modified Finnegan scoring webApp to assess the severity of neonatal abstinence syndrome and opioid withdrawal.
More to come. Thanks for reading this post!
References:
- Hornik K. The Comprehensive R Archive Network. WIREs Comp Stat. 2012;4(4):394-398. doi:10.1002/wics.1212
- RStudio. Accessed November 16, 2020. https://rstudio.com/products/rstudio/
- Contributed Packages. Accessed November 16, 2020. https://cran.r-project.org/web/packages/
- R Packages. Accessed November 16, 2020. https://rstudio.com/products/rpackages/
- Web Application Framework for R [R package shiny version 1.5.0]. Published online June 23, 2020. Accessed November 16, 2020. https://cran.r-project.org/web/packages/shiny/index.html
- Dynamic Documents for R [R package rmarkdown version 2.5]. Published online October 21, 2020. Accessed November 16, 2020. https://cran.r-project.org/web/packages/rmarkdown/index.html
Disclosure: The author identifies no conflict of interest
Corresponding Author

Fu-Sheng Chou, MD, PhD
Senior Associate Editor,
Director, Digital Enterprise
Neonatology Today
Assistant Professor of Pediatrics,
Division of Neonatology, Department of Pediatrics
Loma Linda University Children’s Hospital
FChou@llu.edu
