Skip to contents

traumar (development version)

traumar 1.2.4

CRAN release: 2026-02-05

  • Added the functions to perform all data validation. These functions take the form of validate_*(), such as validate_character_factor(). After exploring options from other packages to lean on existing methods to validate data via functional programming, the decision was made to create functions “in-house” to avoid issues with adding another dependency. The validate_*() family of functions is not exported from traumar.

  • Updated unit tests throughout the package given the addition of new data validation methodology.

  • Ensured that plenty of comments are provided throughout the functions in the package to enhance understanding of the code and collaboration.

  • pretty_number() now uses a digits argument instead of n_decimal. n_decimal has been deprecated and will now issue a warning, but the function will still work using the n_decimal argument. In a later release, n_decimal will be fully deprecated.

  • rmm() and rm_bin_summary() will now fail if the seed argument is not of class numeric or integer.

  • Added section headers throughout the code base to make navigation within most modern IDEs easier.

  • Error/warning messages will now directly name the function in the call stack that is most helpful. For example, if some data validation triggers an error within traumar::seqic_indicator1(), then traumar::seqic_indicator1() will show up in the error message, instead of some other function such as a cli function or one of the new validate_*() functions.

  • Improved small_count_label() code readability in the control flow chunk where values less than the cutoff are manipulated depending on user input.

  • trauma_performance() now acts as a wrapper for trauma_case_mix() as trauma_performance() now calls trauma_case_mix() under the hood instead of explicitly performing the same operations. This makes the functionality more maintainable for any future iterations.

traumar 1.2.3

CRAN release: 2026-01-08

  • probability_of_survival() was updated to enhance code readability and leverage mathematical notation in the calculation of predicted survival probabilities. The function now aligns with the coefficients published in Norouzi et al. (2013) and Merchant et al. (2023). Consistent with Boyd et al. (1987), the function does not treat patients under 15 years of age differently and accounts for penetrating injuries similarly to other age groups. This update ensures a standardized approach to calculating survival probabilities for both blunt and penetrating traumas.

  • From this release forward, all development of traumar will be done in the IDE Positron!

traumar 1.2.2

CRAN release: 2025-08-26

  • rmm(), rm_bin_summary(), and nonlinear_bins(): Updated the documentation for the threshold arguments along with the divisor arguments. These were updated along with the Details section of the nonlinear_bins() function documentation to provide a better explanation of the binning algorithm under the hood.

  • probability_of_survival(): Updated the Return section documentation to be more accurate that the output is not a percentage, it is the predicted probability of survival on a scale from 0 to 1. A previous version of this function was multiplied by 100 to seem more like a percentage.

traumar 1.2.1

CRAN release: 2025-06-24

  • Within the trauma_performance() function, renamed the variable predicted_prob_death to scale_factor which is commensurate with the source literature.

  • updated comments in trauma_performance() for z_method method of the Z_score to reflect the right text.

  • In trauma_performance(), completed the comment where the scale_factor is created so that it is complete and clear.

  • Corrected a test error at CRAN from using bootstrap CI process in testing with 100,000 observations and 100 bootstrap samples to make sure rmm() and rm_bin_summary() ran in under 60 sec. That test now does not use the bootstrap process so the core function can be tested and will always run in under a minute with 100,000 observations.

  • Cleaned up other tests within for relative_mortality.R that were checking for correct error / warning handling where multiple lines of output were sent to the console. Built a custom function to deal with those scenarios and correctly perform those unit tests.

traumar 1.2.0

CRAN release: 2025-05-22

traumar 1.1.0

CRAN release: 2025-03-25

New Features

  • Added optional grouping functionality to nonlinear_bins(), rmm(), and rm_bin_summary().

    • Setting group_vars = NULL applies the functions to the entire dataset without subgrouping.

    • For pivoting the rmm() outputs longer, setting pivot = TRUE will work when group_vars is invoked by pivoting longer with the grouping context.

Enhancements

  • Improved NA handling in rmm() and rm_bin_summary().

  • Ensured RMM calculations remain within the expected range of [-1 to 1], including their 95% confidence intervals.

  • Optimized nonlinear_bins() by replacing its internal for loop with dplyr functions, enhancing accuracy and efficiency without introducing breaking changes.

  • Improved command line messaging and documentation within rmm() and rm_bin_summary() regarding probability of survival values Ps_col < 0 and Ps_col > 1. Now, these functions will throw an error if probability of survival values are Ps_col < 0 or Ps_col > 1.

  • The nonlinear_bins() function has improved data validation for the Ps_col variable.


traumar 1.0.0

CRAN release: 2025-02-21

  • Initial release to CRAN.
  • Achieved comprehensive test coverage (>90%).

traumar 0.0.1.9000