Skip to content

crane

0.3.2Package record

Supplements the 'gtsummary' Package for Pharmaceutical Reporting

1packages dependsuggested by 1
11.7Kdownloads / year
97.1%test coverage
13/13flavors OK

Overview

About

Tables summarizing clinical trial results are often complex and require detailed tailoring prior to submission to a health authority. The 'crane' package supplements the functionality of the 'gtsummary' package for creating these often highly bespoke tables in the pharmaceutical industry.

Changes in 0.3.2

New Functions and Functionality

  • Added g_lineplot() for creating line plots with optional summary statistics table. Includes helper functions calc_stats(), g_lineplot_table(), and preprocess_lineplot_data().
  • Added ard_tabulate_abnormal_by_baseline() for creating an Analysis Results Data (ARD) object counting participants with abnormal assessments, stratified by their baseline status.
  • Added tbl_mmrm() and get_mmrm_results() functions to create regression tables for Mixed Models for Repeated Measures (MMRM). (#163)
  • Added gg_mmrm_lineplot() to create line plots of MMRM results. (#181)
  • Added gg_pkc_lineplot() to create line plots for PK data. (#185)
  • Added annotate_gg_pkc() to add optional summary statistics table to

gg_pkc_lineplot(). (#189)

  • Refactored the underlying data.frame alignment and rendering methodology used for plot annotations. Functions for table annotation now use a completely rebuilt engine that ensures X-axis synchronization for stacked tables (annotate_riskdf()) and flexible, reliable placement for floating tables (annotate_surv_med(), annotate_coxph()). (#189)
  • Refactored functions for lineplot plotting - added gg_lineplot() and annotate_gg() to create lineplots and annotate summary statistics table. (#184)
  • Added functions reverse_ci(), reverse_rate_difference() to reverse confidence intervals and rate differences in tables from add_row_difference(). (#204)
  • g_lineplot(), g_lineplot_table(), and preprocess_lineplot_data() were deprecated. (#184)
Show all changes in 0.3.2Hide the rest of the changes in 0.3.2
  • Added tbl_coxph() to render pairwise Cox proportional hazards results as a gtsummary table. (#159)
  • Added tbl_hierarchical_incidence_rate() which computes the incidence rate of adverse events (#211)
  • Added adjust_stat_columns_wrap() which keep the presentation of statistics in one row (#219)
  • get_cox_pairwise_df() now allows for different methods to compute p-value (#191) and to handle ties (#193).
  • tbl_coxph() now accepts a data.frame created by get_cox_pairwise_df() as input. (#207)
  • Added add_grade_column() to inject a grade-label column into tbl_hierarchical_rate_by_grade() output. Decoupled from the table builder to prevent Cartesian join explosion in tbl_merge(). (#226)
  • get_cox_pairwise_df() now fully supports strata() terms in survival formulas (#256).
  • The "likelihood-ratio" test now intelligently switches between survival::survreg() (for unstratified models) and survival::coxph() (for stratified models) (#256).
  • Stripped package namespace prefixes (e.g., survival::) from survival formulas to prevent evaluation errors (#256).
  • Added ... support in get_cox_pairwise_df() for conf.int (e.g., to adjust CI level) and robust = TRUE (for robust standard errors).

Other Updates

  • tbl_hierarchical_rate_and_count() now emits zero-rows for unobserved factor levels in the first hierarchical variable. (#233)
  • df2gg_aligned() and df2gg_floating() now preserve original ggplot objects in attr(result, "plotlist") for downstream data extraction after combining with cowplot. (#208)
  • Remove warning when data has more levels than needed for grade_groups on tbl_hierarchical_rate_by_grade.
  • Changed the default conf.type from "log" to "plain" (linear) in tbl_survfit_times() and tbl_survfit_quantiles() to align with GDSR guidelines. (#173)
  • Removed bold from headers when using tbl_strata() (#133).
  • Unified border width in theme_gtsummary_roche() to 0.5 for header. (#154)
  • Added example on how to stratify tbl_baseline_chg() by PARAM and split into a list.
  • Adjusted tbl_mmrm() to allow base_df = NULL.
  • Fixed two bugs related to summary statistics calculation in ard_tabulate_abnormal_by_baseline(). (#198)
  • Fixed a bug in gg_pkc_lineplot() causing misplaced error bars on a log scale. (#199)
  • Adjusted gg_pkc_lineplot() to use tbl_roche_summary() for automatic decimals formatting.
  • Adjusted tbl_hierarchical_incidence_rate() to handle first event as well as

all events (#217)

  • Adjusted tbl_baseline_chg() to allow for custiomization of display statistics (#222)
  • Changed baseline statistic argument in tbl_baseline_chg() (#224)
  • Adjusted modify_zero_recode() to account for strings comprising regular and non-breaking spaces (#230)
  • tbl_roche_subgroups() now shows n, Events, and Median per arm when time_to_event is specified. The total column shows Total Events instead of Total n. (#235)
  • Skip tests if suggested packages are missing (Failing test due to missing suggested package #252, @llrs-roche)
  • The default "log-rank" test now uses survival::survdiff() instead of coin, aligning output more closely with SAS and rtables

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 7.2 min · r-devel-linux-x86_64-debian-clang
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-04
  • WARNING12 OK, 1 WARNING2026-07-03
  • OK13 OK2026-06-09
Show 6 earlier changesHide 6 earlier changes
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK13 OK2026-05-09
  • ERROR12 OK, 1 ERROR2026-05-03
  • OK13 OK2026-05-02
  • ERROR11 OK, 1 ERROR2026-04-25
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.3.2
READMEYes · 136 wordsVignettesNoNEWSYes · 100% structured · mentions 0.3.2Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
47 (12 internal)includes a package overview page
Examples that run
89%40 run in a plain check (14 of them under a condition) · 5 never run
Exported functions with examples
97%
Documented parameters
79%
Return-value docs
97%
Help pages citing references
0%

Downloads

11.7K
CRAN downloads in the past year
Rank #5,747 · ~32/day · ~976/mo
Daily download trend is not available in this view yet.
48430 days
1.4K90 days
11.7K1 year
Compare downloads with other packages →
Also on123 r2u9 autocran

Repository

15Stars
7Forks
33Open issues
7Open PRs
5Releases
445Commits
16Commit identities
rreproducible-researchsummary-statisticsgt
445 commits · Last activity 2026-10-15 · 0% stars, 30d · Default branch at 0.4.0.9003, ahead of CRAN 0.3.2 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
90%
Median days to close, 50 most recently updated closed issues
8
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-08-20 · 52026-07-07 · 15
PracticesBeta

16 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/insightsengineering/crane on 2026-10-21.

Continuous integration (3)
GitHub ActionsR CMD check workflowGitLab CI

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (5)
Code of conduct (inherited from insightsengineering)Contributing guideIssue templatesPR template

Funding links: pharmaverse.org

Docs source (3)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-15

pkgdown site last built 2026-10-02

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (2)
lintrRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2026-02-12
    Pull request: opened by its own account
    Commits: 3 by its own account · at least 8 crediting it in the message
  • Claude Codefirst seen 2026-10-14
    Commits: at least 1 crediting it in the message
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
30 external dependencies (excludes base and recommended)

Installing crane adds 85 packages (44 with compiled code, 77 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (2)
R >= 4.2gtsummary
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Depends 1
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (8)
Maintainer since 0.3.1 (2026) · added in 0.3.1
Author
Original creator of the package
Author · added in 0.3.2
Author · added in 0.3.2
Copyright holder, Funder

Previously maintained by Daniel D. Sjoberg (0.1.0 to 0.3.0).

Releases (5)

Pick two releases to compare their code metrics.

  • 0.3.2Latest
    record
    2026-06-03 · current release · diff ↗ ·
    removed 1 export
    g_forest
    added 21 exports
    add_forest, add_grade_column, adjust_stat_columns_wrap, annotate_lineplot_df, annotate_pkc_df, ard_tabulate_abnormal_by_baseline, df_add_poolings, g_lineplot, g_lineplot_table, get_mmrm_results, gg_lineplot, gg_mmrm_lineplot, gg_pkc_lineplot, preprocess_lineplot_data, reverse_ci, reverse_rate_difference, tbl_coxph, tbl_hierarchical_incidence_rate, tbl_mmrm, tbl_rmpt, tbl_with_pools
  • R
    R 4.6.0 released · 2026-04-24
  • 0.3.1
    record
    2026-01-21 · diff ↗ ·
    added 8 exports
    annotate_coxph, annotate_riskdf, annotate_surv_med, g_forest, get_cox_pairwise_df, gg_km, process_survfit, tbl_roche_subgroups
  • 0.3.0
    record
    2025-12-06 · diff ↗ ·
    removed 1 export
    label_style_number
    added 4 exports
    add_difference_row, label_roche_number, style_roche_number, tbl_null_report
  • 0.2.0
    record
    2025-08-29 · diff ↗ ·
    removed 4 exports
    add_blank_row, all_categorical, all_continuous, roche_pvalue
    added 22 exports
    add_blank_rows, add_hierarchical_count_row, add_overall, filter_hierarchical, label_roche_percent, label_roche_ratio, label_style_number, modify_header_rm_md, modify_zero_recode, remove_duplicate_keys, sort_hierarchical, style_roche_percent, style_roche_pvalue, style_roche_ratio, tbl_baseline_chg, tbl_hierarchical_rate_and_count, tbl_hierarchical_rate_by_grade, tbl_listing, tbl_roche_summary, tbl_shift, tbl_survfit_quantiles, tbl_survfit_times
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.0
    record
    2025-02-24
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2025-02-24
Total releases
5 / 1 yrs
License
Apache License 2.0 OSI
Minimum R
≥ 4.2
Download size
271 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("crane")
Zhu, J., F. Hoffmann-La Roche AG, Garolini, D., Sjoberg, D. D., Szczypiński, J., Yogasekaram, A., Zhang, C., & de la Rua, E. (2026). crane: Supplements the 'gtsummary' Package for Pharmaceutical Reporting (Version 0.3.2) [Computer software]. https://doi.org/10.32614/CRAN.package.crane

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for crane version 0.3.2 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy