Leave Manual TFL Creation in the Past — Permanently
In the pharmaceutical and biotech industries, the creation of tables, figures, and listings (TFLs) is a critical but often time-consuming task. Traditionally, this process has been manual, meaning it has been error-prone and resource-intensive. While automation has been possible with tools like SAS, the advent of R, a powerful open-source programming language, offers a more efficient, effective, and interactive way to handle TFL creation.
R enables the creation of interactive TFLs using Shiny, providing efficiency and flexibility in data review. Instead of creating and QC’ing hundreds of static TFLs, reviewers can interactively change filters and data inputs to isolate the outputs they are interested in. Let’s explore how R can upgrade your TFL creation in open-source clinical programming.
The Challenges of Manual TFL Creation
Manual TFL creation involves several steps, including data extraction, manipulation, and formatting. This process is labor-intensive and susceptible to human error. Variability in data handling and presentation can lead to discrepancies, and manual processes require significant time for data validation, cleaning, and formatting.
Additionally, manual data manipulation increase the risk of mistakes, increasing the burden on validation and review. These challenges not only derail the efficiency of clinical trials, but they can also delay the time to market for new drugs. We all understand that every day counts in clinical research. Fortunately, there’s a better way.
The Power of R in TFL Creation
R is a versatile language specifically designed for data analysis and visualization. It offers numerous packages and tools that streamline the TFL creation process. Key benefits of using R for TFLs include:
- Automation: R allows for the automation of repetitive tasks through functions, reducing the need for manual intervention. This ensures consistency and accuracy.
- Efficiency: The powerful ecosystem of R packages in the table world offers tools to put you steps ahead before you start writing any code, such as Tplyr, flextable, officer, and more – significantly cutting down the time required for TFL creation.
- Flexibility: R provides powerful visualization tools like ggplot2, which enable the creation of complex figures and tables with ease.
- Reproducibility: R scripts combined with packages such as renv and envsetup can be easily shared and reused, ensuring that TFLs can be consistently reproduced across different projects and teams.
- Interactivity: With Shiny, R enables the creation of interactive TFLs, allowing for dynamic data exploration and efficient review processes.
Key Features of R for TFL Creation
R’s capabilities in data manipulation and visualization make it an ideal open-source tool for clinical programming. Let’s look at a few key features that enhance TFL creation.
Data Manipulation With dplyr & tidyr
R packages like dplyr and tidyr offer robust functions for data manipulation. These tools allow you to clean and prepare data efficiently, ensuring that the data is in the correct format for TFL creation:1,2
- dplyr facilitates data manipulation by providing functions for filtering, selecting, and summarizing data
- tidyr helps in reshaping and tidying data, making it easier to work with
Advanced Visualization With ggplot2
Next up is ggplot2, a widely used R package for data visualization. It enables the creation of detailed and aesthetically pleasing figures, which are essential for clear, engaging clinical trial reports:3
- Customization: ggplot2 allows for extensive customization of plots, ensuring that the final output meets specific reporting standards
- Consistency: Using ggplot2 ensures that figures are consistently formatted, reducing the risk of misinterpretation
Specialized TFL Creation Packages
These R packages expedite TFL creation by providing advanced capabilities and flexibility:
- Tplyr: Helps you quickly and flexibly prepare and format data for presentation
- flextable and officer: Provide advanced capabilities to style your TFLs and export them to HTML for interactive applications, or publish your data to full Word documents or PowerPoints
Why Use R for Clinical Trial Analytics in Pharma?
The transition from SAS to R is becoming more prevalent in the pharmaceutical industry due to several key advantages that R offers over traditional software solutions: cost-effectiveness, community support, flexibility, and scalability. R’s strong data processing capabilities, statistical programming language, and data visualization tools make it an ideal choice for clinical trial analytics and are driving its adoption across our industry.1
With Shiny, R closes the gap between a data dashboard and regulatory clinical summary, letting both be powered by the same programming language. It also makes creating interactive visualizations accessible to statistical programmers. We have the opportunity to drive new efficiency by allowing our analytics teams to have immediate access to summaries of their data, make decisions faster, and reduce the iterations with programming teams necessary to find the insights they’re looking for. Those factors alone constitute a solid “Why?”, though there are others.
Cost-Effectiveness
As an open-source programming language (free to use), R significantly reduces software costs for organizations. This is particularly important for projects where budget constraints are a pressing concern. By using R, companies can redirect funds typically spent on expensive software licenses toward other critical areas such as research and development, thereby maximizing their overall budget.
Community Support
One of the most compelling reasons to switch to R is its extensive and active community. R’s community continuously contributes to its development, ensuring it remains at the leading edge and highly reliable. This community offers a wealth of resources, including packages, tutorials, forums, and user groups, which greatly aid in learning and problem-solving.
The collaborative environment fosters innovation and keeps the software updated with the latest advancements in data science. Pharma has been embracing R more and more, with communities of packages such as the pharmaverse building packages that are honed for clinical analytics. Atorus has contributed and collaborated on several packages to the pharmaverse, including:
Pharmaverse also includes powerful contributions from many other companies, such as:
- rtables, tern and teal
- gtsummary
- cards and cardx
- tfrmt and tfrmtbuilder
This robust support network makes R a dependable choice for pharmaceutical companies looking to leverage the latest in data analytics technology.
Flexibility and Scalability
R’s ability to integrate seamlessly with other tools and platforms makes it incredibly flexible and scalable. It can handle a wide range of data formats and interface with various software environments, facilitating smooth integration into existing workflows. For instance, R can integrate with SQL databases, Hadoop, and other big data technologies, enabling efficient data extraction and manipulation across different sources. This flexibility allows R to adapt to both small- and large-scale clinical studies, making it a versatile tool for data analysis.
R’s scalability ensures it can efficiently manage and analyze datasets ranging from miniscule to massive, which can be crucial for comprehensive clinical trial analytics.
Furthermore, R’s ecosystem, including packages like data.table and polars, supports high-performance data manipulation, which is essential for handling large datasets typically encountered in clinical research.
Making the Transition to R Programming
Transitioning from SAS to R involves learning new syntax and understanding R’s unique data structures. However, the benefits far outweigh the initial learning curve. Let’s look at some steps to facilitating the transition.1
Training
Investing in training programs that focus on R programming for clinical trials is key. Comprehensive training can help you understand all the essentials of R, including its syntax, data manipulation techniques, and specific applications in clinical trial analytics.
Training also helps in understanding the integration of R with existing systems, making the transition smoother and more effective. Specialized training can also introduce users to best practices for regulatory compliance and data security in clinical settings, ensuring that the transition to R is not only smooth but also adheres to industry standards.
Atorus offers specialized training programs designed to upskill your team in R programming, providing hands-on experience and expert guidance. Check out Atorus Academy for more info.
Mentorship
Pairing with experienced R users for guidance and support can significantly ease the transition, allowing new users to learn from experts who have practical knowledge of using R in clinical trials. Mentors can offer personalized advice, troubleshoot issues in real time, and share best practices, which accelerates the learning process. This one-on-one support helps in building confidence and competence in using R for complex data analysis tasks.
Mentorship can also help users understand the nuances of integrating R with other tools used in clinical trials, such as SAS, and managing version control and collaborative development using platforms like GitHub. In short, mentorship provides a hands-on learning experience, allowing new users to learn from experts who have practical knowledge of using R in clinical trials — an invaluable addition to one’s training plan.
Practice, Practice, Practice …
Applying R to small projects helps in building confidence and competence, as less complex, time-sensitive, or mission-critical projects allows users to apply their learning in real-world scenarios without the pressure of critical outcomes. This practical approach reinforces theoretical knowledge, helps in understanding the nuances of R, and gradually builds the expertise needed to handle larger, more complex datasets.
Over time, consistent practice enables users to master R, making it a powerful tool in their data analytics arsenal. Regular practice also provides opportunities to explore R’s extensive package ecosystem, allowing users to identify and utilize tools that can streamline their workflow and enhance data analysis capabilities.
Take the Leap and Embrace the Future of Clinical Programming
By focusing on structured training, seeking mentorship, and practicing with small projects, organizations can effectively transition from SAS to R. This transition not only enhances the efficiency of clinical trial analytics but also positions the organization at the forefront of innovation in the pharmaceutical industry.
R’s open-source nature, combined with its powerful analytics capabilities, fosters a more collaborative and innovative research environment — essential for the long-term viability of every organization in our fast-moving industry. Embracing the benefits of R programming can be a massive boon for those seeking a more flexible, transparent, and reproducible approach to clinical programming.
Ready to Take Your TFL Creation Process to the Next Level?
Contact Atorus to learn more about our advanced data science solutions.
References
1 Wickham, H., et al. R for Data Science: Import, Tidy, Transform, Visualize, and Model Data.
2 Wickham, H. Advanced R. Chapman and Hall/CRC Press. Published 2019 May 24.
3 Wickham, H., et al. ggplot2: Elegant Graphics for Data Analysis (3e). (n.d.).