This is an R package for generating RTF (Rich Text Format) tables, figures, and listings. As a senior data scientist maintaining this package, I should be familiar with RTF syntax and R package development best practices.
- Package Purpose: Generate RTF tables, figures, and listings programmatically in R
- Domain: Clinical trial reporting and data visualization
- RTF Expertise: Understanding of RTF syntax and specification is essential
- R Version: 4.5.1 on macOS (aarch64-apple-darwin24.4.0)
- Follow R package development best practices
- Maintain backward compatibility when possible
- Ensure RTF output conforms to specification
- Test thoroughly with various table/figure configurations
- Always run tests before committing changes
- Load package for development:
devtools::load_all() - Run all tests:
devtools::test() - Run specific tests:
devtools::test(filter = "rtf_title") - Build package:
devtools::build() - Check package:
devtools::check() - Generate/update documentation:
devtools::document()orroxygen2::roxygenise() - Install package locally:
devtools::install() - Build pkgdown site:
pkgdown::build_site()ordevtools::build_site() - Build reference only:
pkgdown::build_reference() - Build articles only:
pkgdown::build_articles()
Required system libraries for development:
libgit2- for gert packageharfbuzz,fribidi- for textshaping packagefreetype,libpng,libtiff,libjpeg-turbo- for ragg packagepkg-config- for package configurationpandoc- for building documentation and vignettes
Install with: brew install libgit2 harfbuzz fribidi freetype libpng libtiff libjpeg-turbo pkg-config pandoc
For better dependency management, use pak:
# Install pak if not available
install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/")
# Install development tools
pak::pkg_install(c("devtools", "tidyverse", "testthat", "roxygen2", "pkgdown", "emmeans"))rtf_title()- Add title attributes to tablesrtf_colheader()- Add column header attributes to tablesrtf_subline()- Add subline attributes to tablesrtf_body()- Format table bodyrtf_footnote()- Add footnotes to tablesrtf_source()- Add source information to tablesrtf_page()- Set page attributes
- Issue #235: Added
text_hyphenationparameter tortf_title(),rtf_colheader(), andrtf_subline()functions- Default value is
TRUEfor backward compatibility - Allows users to control text hyphenation in RTF output
- Branch:
feature/issue-235-text-hyphenation
- Default value is
- DESCRIPTION: Package metadata
- NAMESPACE: Exported functions
- R/: Source code
- tests/testthat/: Unit tests
- man/: Documentation (auto-generated by roxygen2)
- vignettes/: Package vignettes
- inst/: Additional package files
- Unit tests using
testthatframework - Test files named
test-independent-testing-*.R - Snapshot tests for complex output validation
- Always verify changes don't break existing functionality