Recently, a growing number of R packages are appearing for clinical trials. The implementation of all possible standards required for submission to the FDA, such as the creation of .XPT, the development of SDTM and ADAM, has long been in place.

It should be noted that when your company has an integrated system of Standard Operating Procedures, huge macro libraries, a large number of SAS specialists, and even presentations in the Business Development department refer to SAS, it is very difficult to start developing the R direction right away.

However, the paper written by Uday Palukuru, RUNCHENG LI, Nileshkumar Patel and Changhong Shi ( gives an interesting idea: to use the strong points of R on the one hand and the possibility of starting with the validation side.

Reading in image data and compare is simplified owing to the powerful image processing functions available within the imager package to process the images from .png files.

The function load.image() can be used to read in images. The as.pixset(plotA - plotB) function declaration can be used to return the difference between two pixset matrices. The differences can be highlighted by superimposing the differences onto the compared pixset matrix.

A snippet of code that does the comparison is shown below:
diff <- as.pixset(plotA - plotB)
comp <- colorise(plotA, diff, "red", alpha=1)

As can be seen from the output image, the discrepancies between two images are highlighted in red which is enables easier validation of graphical outputs. This workflow uses less resource than a comparable SAS® program to compare the differences in case of figures. Thus, R can be used as a validation tool to increase efficiency and to automate the validation process. And here at TUNECT CRO we are confident that starting to implement the graphic benefits of R can be a very efficient stage in the validation phase.

P.S. the article, of course, contains not only the method we loved, the paper considers the problem much broader. Make sure you check!