R Package Validation Infrastructure

Validation
R Package
Software
Clinical Trials
GxP
Validation framework for rpact

rpact.validator

Overview

The rpact.validator package is an R package designed to facilitate the validation and documentation of unit tests, user requirements, and functional specifications for R packages. It provides tools to generate LaTeX documents, CSV files, and R Markdown templates for validation purposes, ensuring compliance with rigorous testing standards.

Features

  • Unit Test Documentation: Automatically documents unit test results in LaTeX format, including detailed statistics such as passed, failed, skipped tests, and time consumption metrics (User, Sys, Real).
  • Validation Documentation: Generates validation documentation for R packages, including customer-specific PDFs with login credentials for secure access.
  • User Requirements Specification (URS): Extracts Roxygen-style annotations from R scripts to generate URS documents in R Markdown format, along with CSV files for structured requirements management.
  • Utilities: Provides helper functions for file handling, formatting, and validation-related operations, such as generating .htaccess and .htpasswd files for secure access to validation documents.
  • Integration with rpact: Seamlessly integrates with the rpact package for validation and testing purposes.

Key Functions

Unit Test Documentation

  • documentAllUnitTests(): Documents all unit tests as LaTeX files, including summary tables and time statistics.
  • createOverallUnitTestsTable(): Generates an overall summary table for unit test results.
  • createTimeStatsTable(): Creates a table summarizing time consumption statistics for unit tests.

Validation Documentation

  • createValidationDokumentation(): Creates validation documentation as LaTeX documents and compiles them into customer-specific PDFs.
  • createUnitTestAccessFiles(): Generates .htaccess and .htpasswd files for secure access to validation documents.

User Requirements Specification (URS)

  • generateUrs(): Scans R scripts for Roxygen-style annotations and generates URS documents in R Markdown format.

Utilities

  • writeLinesToFile(): Writes content to a file.
  • readLinesFromFile(): Reads content from a file.
  • getClassFields(), getClassMethods(): Extracts fields and methods from S4, R6, and reference classes.