Skip to Content

Automated Emailing of Sweave Reports for supporting Quality Improvement in Healthcare

dyergens's picture


One of the more important aspects for applying Quality Improvement in Healthcare is the reporting of information on a timely and continuous basis.

Traditionally, this reporting has been in the form of weekly or monthly reports and increasingly through the use of both active and passive dashboards. Even though active reporting dashboards allow the ability for interactivity such as filtering or drilling down of on the data, many senior administrators simply lack the time to fully take advantage of this technology. Therefore, the automated report continues to remain a staple in the world of reporting Quality Improvement information.

R allows a Quality Improvement specialist to move past simple reports that traditionally has included trending charts (line, bar, pie) and descriptive table information to more sophisticated analysis. And with new tools such as RStudio's IDE with Sweave integration has allowed easier development and deployment of R and Sweave PDF reports.

What we developed to aid in the daily, weekly and monthly reporting of data of Continuous Quality Improvement (CQI) activities was a java application for automating the email distribution of R
PDF reports written in Sweave.

The RMail (prototype name) application allows a user to simply set up automated distribution of Sweave reports via email to a number of users.

The RMail Application

RMail installs as an executable on the Windows platform. Once launched the user can see all the reports that are currently configured in the system (figure 1).

The user then can add a Sweave file (.Rnw) and configure the settings as to when to send the out the email (figure 2). These configuration options include Daily, Specific Weekday (Monday, Tuesday, et), Weekdays (Monday to Friday), Monthly and Quarterly and time of day.

The user can also add a Title which is used as the Email Subject and the text of the Email Body. Additionally, the user can choose to archive all the PDFs emailed out and also to enable/disable the reports. The user then enters in all the emails that this specific Sweave report will be emailed to.

Rmail Main Screen
Figure 1 - Rmail Main Screen

Rmail Configuration Screen
Figure 2 - Rmail Configuration Screen

How to Get RMail

Over the month of November I'll set up a webpage that will allow people to download the RMail application with some documentation.

Crazy Other Ideas for RMail

One CRAZY suggestion was to have graduate students (i.e. me) automatically email my analysis (thesis) to my supervisors on a weekly basis to see my current progress.

We have also used RMail for running large batch runs of R analysis in the evenings and over the weekends as each Sweave report was taking 6-8hours to run.


RMail is an excellent example of how R can be used in a business environment such as healthcare to deliver via email sophisticated analysis for supporting continuous quality improvement projects in an automated manner.


lowell.it1's picture

Our flagship link building service – Paint It White. Links from manually created beautiful web 2.0 posts on premium blogs. Supported by an array of tier 2 and 3 links for maximum ranking increases
link building service

william2johns's picture

There is a lot of confusion about business letters and many people are not sure exactly what a "business letter" really is. In fact, the term "technical writing service" is a very general one that can mean many different specific letter types. This article clears up the confusion.

kinneybowles's picture

it's hard to believe but it's still advisable and i highly recommend brainwave entrainment with the use of brain entrainment cds