Package: repfun 0.1.2

Chris Rook

repfun: Create Tables, Listings and Figures using Functions Styled after SAS™ Macros

Mimic the style of traditional reporting macros for clinical trials. The purpose is to generate tables, listings and figures that support clinical research. This package is well suited for firms or individuals who wish to incorporate R without changing their ways of working as it follows a traditional clinical research workflow. Invoke functions (instead of macros) to summarize data and produce formatted reports. This package differs from others in that it includes tools (wrappers) for both analyzing and reporting data.

Authors:Chris Rook [aut, cre], Yongwei Wang [aut], GlaxoSmithKline Research & Development Limited [cph, fnd]

repfun_0.1.2.tar.gz
repfun_0.1.2.zip(r-4.7)repfun_0.1.2.zip(r-4.6)repfun_0.1.2.zip(r-4.5)
repfun_0.1.2.tgz(r-4.6-any)repfun_0.1.2.tgz(r-4.5-any)
repfun_0.1.2.tar.gz(r-4.7-any)repfun_0.1.2.tar.gz(r-4.6-any)
repfun_0.1.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
repfun/json (API)

# Install 'repfun' in R:
install.packages('repfun', repos = c('https://gsk-biostatistics.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/gsk-biostatistics/repfun/issues

Pkgdown/docs site:https://gsk-biostatistics.github.io

Datasets:

On CRAN:

Conda:

7.13 score 1 stars 100 scripts 206 downloads 27 exports 80 dependencies

Last updated from:f95a24012c. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK241
source / vignettesOK284
linux-release-x86_64OK232
macos-release-arm64OK123
macos-oldrel-arm64OK175
windows-develOK175
windows-releaseOK188
windows-oldrelOK172
wasm-releaseOK159

Exports:%>%copydatarem_pg_numsrs_setupru_addbignvarru_addpageru_addsuppru_alignru_contentsru_data2codelistru_datacompareru_datetimeru_denormru_expvarlistru_fillcodedcoderu_fillnaru_freqru_getdataru_groupbyvarsru_labelsru_libnameru_listru_load_libraryru_setdataru_stackvarru_sumstatsru_width_rtf

Dependencies:arrowassertthatbackportsbase64encbitbit64bslibcachemcheckmateclicliprclustercolorspacecpp11crayondata.tabledigestdplyrevaluatefarverfastmapfontawesomeforcatsforeignFormulafsgenericsggplot2gluegridExtragtablehavenhighrHmischmshtmlTablehtmltoolshtmlwidgetsisobandjquerylibjsonliteknitrlabelinglifecyclemagrittrmemoisemimennetpillarpkgconfigprettyunitsprogresspurrrr2rtfR6rappdirsRColorBrewerreadrrlangrmarkdownrpartrstudioapiS7sassscalesstringistringrtibbletidyrtidyselecttinytextzdbutf8vctrsviridisLitevroomwithrxfunxportryaml

Proc-Contents
Vignette Build Datetime | Generate a Proc Contents style report of a data frame in R | Display the result

Last update: 2026-01-20
Started: 2025-11-18

Add-Big-N-to-DataFrame
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Add Big N to ADAE | Display the Results of Adding Big N to ADAE

Last update: 2026-01-06
Started: 2025-11-18

Get-Data-for-Population
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE, Restrict to Population and Add Population Variables | Display the Results for AE Body System and Preferred Term

Last update: 2026-01-06
Started: 2025-11-18

AE-Tbls
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Generate Frequency Counts and Percents | Select Page(s) of Table 1 (1) | DDDATA for Table 1 (First few obs) | Table 1 RTF | Table 1 PDF | Select Page(s) of Table 2 (1) | DDDATA for Table 2 (First few obs) | Table 2 RTF | Table 2 PDF | Select Page(s) of Table 3 (1) | DDDATA for Table 3 (First few obs) | Table 3 RTF | Table 3 PDF | Select Page(s) of Table 4 (1) | Note: There is no DDDATA for Table 4 | Table 4 RTF | Table 4 PDF | Select Page(s) of Table 5 (1) | DDDATA for Table 5 (First few obs) | Table 5 RTF | Table 5 PDF | Select Page(s) of Table 6 (1) | DDDATA for Table 6 (First few obs) | Table 6 RTF | Table 6 PDF | Select Page(s) of Table 7 (1) | DDDATA for Table 7 (First few obs) | Table 7 RTF | Table 7 PDF | Select Page(s) of Table 8 (1) | DDDATA for Table 8 (First few obs) | Table 8 RTF | Table 8 PDF | Select Page(s) of Table 9 (1) | DDDATA for Table 9 (First few obs) | Table 9 RTF | Table 9 PDF | Select Page(s) of Table 10 (1) | DDDATA for Table 10 (First few obs) | Table 10 RTF | Table 10 PDF | Select Page(s) of Table 11 (1) | DDDATA for Table 11 (First few obs) | Table 11 RTF | Table 11 PDF | Select Page(s) of Table 12 (1) | DDDATA for Table 12 (First few obs) | Table 12 RTF | Table 12 PDF | Select Page(s) of Table 13 (1) | DDDATA for Table 13 (First few obs) | Table 13 RTF | Table 13 PDF | Select Page(s) of Table 14 (1) | DDDATA for Table 14 (First few obs) | Table 14 RTF | Table 14 PDF | Clean up Temporary Files

Last update: 2025-12-10
Started: 2025-11-18

Dem-Tbls
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Make Lists for Coding and Decoding ADSL Variables | (Codes for Ordering Categories, Decodes for Category Labels) | Perform the Coding and Decoding | Iterate over ADSL and Process a List of Categorical (Counts/Percents) and Numeric (Summary Statistics) Variables | Add Big N Value for Column Headers | Select Page(s) of Table 15 (1) | DDDATA for Table 15 (First few obs) | Table 15 RTF | Table 15 PDF | Select Page(s) of Table 16 (1) | DDDATA for Table 16 (First few obs) | Table 16 RTF | Table 16 PDF | Select Page(s) of Table 17 (1) | DDDATA for Table 17 (First few obs) | Table 17 RTF | Table 17 PDF | Select Page(s) of Table 18 (2) | DDDATA for Table 18 (First few obs) | Table 18 RTF | Table 18 PDF | Select Page(s) of Table 19 (1) | DDDATA for Table 19 (First few obs) | Table 19 RTF | Table 19 PDF | Select Page(s) of Table 20 (1) | DDDATA for Table 20 (First few obs) | Table 20 RTF | Table 20 PDF | Select Page(s) of Table 21 (1) | DDDATA for Table 21 (First few obs) | Table 21 RTF | Table 21 PDF | Select Page(s) of Table 22 (1) | DDDATA for Table 22 (First few obs) | Table 22 RTF | Table 22 PDF | Select Page(s) of Table 23 (1) | DDDATA for Table 23 (First few obs) | Table 23 RTF | Table 23 PDF | Clean up Temporary Files

Last update: 2025-12-08
Started: 2025-11-18

Figures
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Select Page(s) of Figure 1 (1) | DDDATA for Figure 1 | Figure 1 RTF | Figure 1 PDF | Select Page(s) of Figure 2 (1) | DDDATA for Figure 2 | Figure 2 RTF | Figure 2 PDF | Clean up Temporary Files

Last update: 2025-12-08
Started: 2025-11-18

Convert-RTF-to-PDF
Vignette Build Datetime | Create Folder Structure on Windows

Last update: 2025-12-02
Started: 2025-11-18

Load-Libraries
Vignette Build Datetime | Load Libraries | Create a vector of packages to load. | Unload all packages in the list above. | Reload all packages in the list above. | Confirm all packages in the list above are loaded.

Last update: 2025-12-01
Started: 2025-11-18

Add-Decode-Variable
Vignette Build Datetime | Load Libraries | Define data library | Read in Format Data Set | Make List from Format Data Set | Apply the List to Create a Decode Variable on ADSL | Display the Results

Last update: 2025-11-25
Started: 2025-11-18

Add-Page-Numbers-to-Dataframe
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Apply Population | Generate Counts and Percents for AE Body System and Preferred Term then Denormalize It | Add Simple Page Numbers then Display the Dataframe using 30 Rows in Body of Report | Add Paging using NoSplitVars when it Won't Work with 30 Rows in Body of Report | Add Paging using NoSplitVars when it Will Work with 35 Rows in Body of Report

Last update: 2025-11-25
Started: 2025-11-18

Add-Supplemental-to-Domain
Vignette Build Datetime | Load Libraries | Define data library | Read SDTM DM and SUPPDM domains | Show Supplemental Data to Append | Combine DM and SUPPDM data sets | Display the Results

Last update: 2025-11-25
Started: 2025-11-18

Align-Columns-for-TLF-Reporting
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Apply Population | Generate Counts and Percents for AE Body System and Preferred Term | Denormalize the AE Counts and Percents Data Set | Align the Columns for TLF Reporting | Display the Aligned AE Counts and Percents Data Set | Generate Counts and Percents for Baseline Characteristics Data | Denormalize the Baseline Characteristics Summary Statistics Data | Display the Aligned Baseline Characteristics Summary Statistics Data Set

Last update: 2025-11-25
Started: 2025-11-18

Convert-Format-Data-to-Codelist
Vignette Build Datetime | Load Libraries | Invoke Setup Function | Convert RFMTDIR Format Data Set to List | Display the Results

Last update: 2025-11-25
Started: 2025-11-18

Convert-Strings-to-Dates
Vignette Build Datetime | Load Libraries | Define library as a libname | Use Libname to Access SDTM.AE Data | Add times to the character dates | Convert character dates to formatted R date variables | Display the results

Last update: 2025-11-25
Started: 2025-11-18

Denormalize-A-DataFrame
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Apply Population | Generate Counts and Percents for AE Body System and Preferred Term | Denormalize the AE Counts and Percents Data Set | Display the Denormalized AE Counts and Percents Data Set | Derive Summary Statistics for Baseline Characteristics Data | Denormalize the Baseline Characteristics Summary Statistics Data Set | Display the Denormalized Baseline Characteristics Summary Statistics Data Set

Last update: 2025-11-25
Started: 2025-11-18

Generate-Counts-and-Percents
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Update ADSL and ADAE | Generate Counts and Percents for AE Body System and Preferred Term | Display the Results for AE Body System and Preferred Term | Generate Counts and Percents for AE Preferred Term Only | Display the Results for AE Preferred Term Counts and Percents | Generate Counts and Percents for Demographic Data | Display the Results for Counts and Percents of Demographic Data

Last update: 2025-11-25
Started: 2025-11-18

Generate-Relative-Column-Widths-for-RTF-Reporting
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Apply Population | Generate Counts and Percents for AE Body System and Preferred Term then Denormalize It and Add Page Numbers | Example 1: Generate a List of Relative Column Widths for RTF Reporting with No Defaults | Example 2: Generate a List of Relative Column Widths for RTF Reporting with Defaults

Last update: 2025-11-25
Started: 2025-11-18

Generate-Summary-Statistics
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Update ADSL and ADVS | Generate Summary Statistics for Baseline Characteristics | Display the Results for Baseline Characteristics | Generate Summary Statistics for Vital Signs with Constant Precision | Display the Results for Vital Signs with Constant Precision | Generate Summary Statistics for Vital Signs with Varying Precision

Last update: 2025-11-25
Started: 2025-11-18

Global-Reporting-Setup
Vignette Build Datetime | Load Libraries | Set Up the Global Environment | Use Libname to Access and Subset Data | Display the Result, add Study ID to Title

Last update: 2025-11-25
Started: 2025-11-18

Library-Setup
Vignette Build Datetime | Load Libraries | Define Libnames | Use Libname to Access and Subset Data | Display the Result

Last update: 2025-11-25
Started: 2025-11-18

Stack-Variables
Vignette Build Datetime | Load Libraries | Set Up the Reporting Environment | Read in ADAE and Apply Population | Generate Counts and Percents for AE Body System and Preferred Term then Denormalize | Stack Body System and Preferred Term | Display the Data Set Containing the Stacked Column

Last update: 2025-11-25
Started: 2025-11-18

Data-Compare
Vignette Build Datetime | Load Libraries | Build Data Frames for Compare | Compare the Data Frames | Display the Results

Last update: 2025-11-21
Started: 2025-11-18

Set-Data
Vignette Build Datetime | Load Libraries | Append data frames with different columns | Display the Results

Last update: 2025-11-21
Started: 2025-11-18

Add-Labels
Vignette Build Datetime | Before Adding Labels | After Adding Labels Using Base Method | After Adding Labels Using Hmisc Method

Last update: 2025-11-18
Started: 2025-11-18

Add-Remove-Decode-Variables
Vignette Build Datetime | Add Decode Variables to the Incoming List | Remove Decode Variables from the Incoming List

Last update: 2025-11-18
Started: 2025-11-18

Fill-Missings
Vignette Build Datetime | Load Libraries | Before Filling Missings | After Filling Missings

Last update: 2025-11-18
Started: 2025-11-18

SAS-Type-Variable-Expansion
Vignette Build Datetime | Load Libraries | Example 1: SAS Type Expansion of Variable List | Example 2: SAS Type Expansion of Variable List | Example 3: SAS Type Expansion of Variable List

Last update: 2025-11-18
Started: 2025-11-18

Readme and manuals

Help Manual

Help pageTopics
ADaM ADAEadae
ADaM ADSLadsl
ADaM ADVSadvs
Adverse Eventsae
Updated airquality for testing.airquality_4test
Updated airqualityairquality_updated
Copy package data to the directory specified.copydata
Demographydm
Data frame of SAS formatsformats
This is the mtcars data frame with labels added for columns mpg and cyl.mtcars_w2lbls
Remove floating page numbers from RTF files.rem_pg_nums
Pass values to setup function and the global environment will be arranged for use reporting tools.rs_setup
Assign Big N to Data Frame.ru_addbignvar
Add a Page Number Column to an Existing Dataframeru_addpage
Cobmine an SDTM domain with its corresponding Supplemental data setru_addsupp
Align Columns for Reportingru_align
Generate proc contents of data frame similar to that generated by SASru_contents
Return a list with codelist, code and label based on input codelist dataset.ru_data2codelist
Compare 2 data frames and report differences.ru_datacompare
Add numeric datetimes to data frame that only has character versions.ru_datetime
Transpose a Data Frameru_denorm
Expand SAS Style Variable/Column Listru_expvarlist
Fill missing code/decode recordsru_fillcodedcode
Fill NA values with specified values or zeros/blanks by default.ru_fillna
Create Percentage based on Numerator and Denominator Dataru_freq
Assign Big N to Data Frame.ru_getdata
Modify groupbyvars by adding or removing decode vars.ru_groupbyvars
Assign labels to variables in a data frameru_labels
Automate retrieval of data sets/frames in specified folder.ru_libname
R function to mimic the SAS macro %tu_list.ru_list
Load a list of librariesru_load_library
Append data sets even when variables do not matchru_setdata
Stack Columns of a Dataframe into New Columnru_stackvar
Calculate Descriptive Statisticsru_sumstats
Create a List of Relative Widths of Columns for RTF Outputsru_width_rtf
Supplemental Adverse Eventssuppae
Supplemental Demographysuppdm