Skip to content

Releases: insightsengineering/tern

v0.9.6 cran

24 Sep 05:36
ceb70fc
Compare
Choose a tag to compare

Enhancements

  • Added errorbar_width and linetype parameters to g_lineplot.
  • Added the .formats argument to tabulate_rsp_subgroups and tabulate_survival_subgroups to allow users to specify formats.
  • Added the riskdiff argument to tabulate_rsp_subgroups and tabulate_survival_subgroups to allow users to add a risk difference table column, and function control_riskdiff to specify settings for the risk difference column.
  • Added warning to tabulate_rsp_subgroups when pval statistic is selected but df has not been correctly generated to add p-values to the output table.
  • Added n_rate statistic as a non-default option to estimate_incidence_rate which returns both number of events observed and estimated incidence rate.
  • Added n_unique statistic as a non-default option to estimate_incidence_rate which returns total number of patients with at least one event observed.
  • Refactored estimate_incidence_rate to work as both an analyze function and a summarize function, controlled by the added summarize parameter. When summarize = TRUE, labels can be fine-tuned via the new label_fmt argument to the same function.
  • Added fraction statistic to the analyze_var_count method group.
  • Improved summarize_glm_count() documentation and all its associated functions to better describe the results and the functions' purpose.

Bug Fixes

  • Added defaults for d_count_cumulative parameters as described in the documentation.
  • Fixed a bug of empty levels on g_lineplot x-axis were not shown in either plots.
  • Fixed a bug in a_surv_time that threw an error when split only has "is_event".
  • Fixed disappearing line in g_lineplot when using only one group or strata level.
  • Fixed defaults for formats and labels in get_formats_from_stats and get_labels_from_stats.
  • Fixed bug for linear scaling factor (scale parameter) being applied to response but not to rate in h_glm_count while all distributions have logarithmic link function.
  • Fixed bug in decorate_grob that did not handle well empty strings or NULL values for title and footers.
  • Fixed bug in g_km that caused an error when multiple records in the data had estimates at max time.
  • Fixed issue with wrong wrapping due to different \n and vector behavior that did not cope well with split_string().

Miscellaneous

  • Began deprecation of the confusing functions summary_formats and summary_labels.
  • Enhanced general descriptions of analyze and summarize functions throughout package documentation.
  • Finalized deprecation of the strata and cohort_id arguments to g_lineplot.
  • Moved incidence rate helper functions into a separate h_incidence_rate.R file.

What's Changed

Full Changelog: v0.9.5...v0.9.6

v0.9.5 cran

21 Jun 05:49
6d6da70
Compare
Choose a tag to compare

Enhancements

  • Added facet_var to g_lineplot to allow plot faceting by a factor variable.
  • Added examples and tests for label_all parameter to extract_survival_biomarkers and extract_survival_subgroups.
  • Added the xticks, xlim, and ylim arguments to g_lineplot to allow for customization of the x and y axes.
  • Updated g_lineplot legend to follow factor levels set by users.

Bug Fixes

  • Fixed a bug in s_ancova that prevented statistics from being printed when arm levels include special characters.
  • Fixed a bug in decorate_grob that prevented the right margins to be respected when adding title and footers decorations.

Miscellaneous

  • Began deprecation of the unused label_all parameter to tabulate_survival_biomarkers and tabulate_survival_subgroups, with redirection to the same parameter in their associated extract_* functions.

What's Changed

  • Fix documentation for the label_all argument of extract_* functions by @edelarua in #1232
  • Manually specify shapes within g_lineplot when >6 group levels exist by @edelarua in #1234
  • update g_lineplot code to handle special characters by @ayogasekaram in #1230
  • Add revdepcheck configuration by @walkowif in #1228
  • Fix bug in s_ancova when arm levels include special characters by @edelarua in #1242
  • Fix indentation in functions that use matrix_form by @edelarua in #1239
  • Add xticks, xlim, and ylim arguments to g_lineplot by @edelarua in #1244
  • fix decorate grob vp widths for titles and footers when right margin is present by @Melkiades in #1245
  • Truetype pagination PR check by @gmbecker in #1250
  • testing for rtables higher level ns PR by @gmbecker in #1251
  • prep for 0.9.5 [skip vbump] by @shajoezhu in #1253

New Contributors

Full Changelog: v0.9.4...v0.9.5

v0.9.4

17 Apr 07:29
2d9280e
Compare
Choose a tag to compare

New Features

  • Added h_glm_negbin to h_glm_count to enable count data analysis using a negative binomial model.
  • Added argument grade_groups_only to count_occurrences_by_grade to allow users to only display rows for specified grade groups.
  • Added internal function df2gg that converts data.frame objects to ggplot objects.
  • Added functions control_surv_med_annot and control_coxph_annot to configure g_km annotation table sizes/positions.
  • Refactored g_km to output a ggplot object instead of a grob object.
  • Refactored g_forest to output a ggplot object instead of a grob object.

Enhancements

  • Default format for mean p-values (mean_pval) updated from "xx.xx" to "x.xxxx | (<0.0001)".

Bug Fixes

  • Fixed nested column split label overlay issue in rtable2gg to clean up appearance of text labels.
  • Fixed bug in s_ancova causing incorrect difference calculations for arm variables with irregular levels.
  • Fixed bug in format_count_fraction_fixed_dp that did not have the same print when the fraction was 1 (100%).
  • Fixed bug in g_lineplot causing default labels not to update according to specified control settings.
  • Fixed bug causing an error when automatic value formatting was applied to NA values.

Miscellaneous

  • Added function expect_snapshot_ggplot to test setup file to process plot snapshot tests and allow plot dimensions to be set.
  • Adapted to argument renames introduced in ggplot2 3.5.0.
  • Renamed individual_patient_plot.R to g_ipp.R.
  • Removed all instances of deprecated parameters time_unit_input, time_unit_output, na_level and indent_mod.
  • Removed deprecated functions summarize_vars, control_summarize_vars, a_compare, create_afun_summary, create_afun_compare, and summary_custom.
  • Removed vdiffr package from Suggests in DESCRIPTION file.
  • Began deprecation of the named element strat, to be renamed to strata, within the variables argument to h_rsp_to_logistic_variables, h_logistic_mult_cont_df, h_odds_ratio_subgroups_df, h_coxreg_mult_cont_df, h_coxph_subgroups_df, h_tbl_coxph_pairwise, extract_rsp_biomarkers, extract_rsp_subgroups, extract_survival_biomarkers, and extract_survival_subgroups.
  • Began deprecation of the strat argument to s_coxph_pairwise and replaced it with the strata argument.
  • Began deprecation of the forest_grob, forest_dot_line, forest_viewport, vp_forest_table_part, and grid.forest functions.
  • Began deprecation of no longer used Kaplan-Meier helper functions h_ggkm, h_decompose_gg, h_km_layout, h_grob_tbl_at_risk, h_grob_median_surv, h_grob_y_annot, and h_grob_coxph.
  • Began deprecation of grob/grid related functions stack_grobs, arrange_grobs, and draw_grob which are no longer used in tern.

What's Changed

New Contributors

Full Changelog: v0.9.3...v0.9.4

v0.9.3

08 Dec 17:05
dd9f020
Compare
Choose a tag to compare

New Features

  • Added ref_group_position function to place the reference group facet last, first or at a certain position.
  • Added keep_level_order split function to retain original order of levels in a split.
  • Added level_order split function to reorder manually the levels.
  • Added function get_indents_from_stats to format and return indent modifiers for a given set of statistics.
  • Added internal utility function apply_auto_formatting to check for "auto" formats and replace them with
    implementation of format_auto in analyze functions.
  • Added utility function labels_use_control to modify labels with control specifications.
  • Added list containing default statistics for each method group, tern_default_stats.
  • Added summarize function version of count_occurrences analyze function, summarize_occurrences.
  • Added referential footnotes to surv_time for censored range observations, controlled via the ref_fn_censor parameter.
  • Added helper function h_adlb_abnormal_by_worst_grade to prepare ADLB data to use as input in count_abnormal_by_worst_grade.
  • Added function rtable2gg that converts rtable objects to ggplot objects.
  • Added helper function to set default na_str globally with set_default_na_str() and added default_na_str() for all interested functions.

Enhancements

  • Added ref_group_coxph parameter to g_km to specify the reference group used for pairwise Cox-PH calculations when annot_coxph = TRUE.
  • Added annot_coxph_ref_lbls parameter to g_km to enable printing the reference group in table labels when annot_coxph = TRUE.
  • Added x_lab parameter to g_lineplot to customize x-axis label.
  • Remove 25% padding of y-axis in g_lineplot.
  • Added support for creating multiple risk difference columns, each comparing to a single comparison group. Multiple comparison groups can be specified as a vector via the arm_y argument.
  • Allowed numeric vector as count_by input in analyze_num_patients and summarize_num_patients.
  • Aligned plot and table vertically in g_lineplot.

Bug Fixes

  • Fixed bug in decorate_grob preventing text wrapping from accounting for font size.
  • Fixed implementation of na_str argument in all column-wise analysis and tabulation functions.

Miscellaneous

  • Specified minimal version of package dependencies.
  • Upgraded to_string_matrix to take into account widths and other printing parameters.

What's Changed

New Contributors

Full Changelog: v0.9.2...v0.9.3

v0.9.2

20 Oct 10:44
605f6cd
Compare
Choose a tag to compare

New Features

  • Added the na_str argument to analyze & summarize_row_groups wrapper functions count_abnormal, count_abnormal_by_baseline, count_abnormal_by_marked, count_abnormal_by_worst_grade, count_abnormal_lab_worsen_by_baseline, count_cumulative, count_missed_doses, count_occurrences, count_occurrences_by_grade, summarize_occurrences_by_grade, summarize_patients_events_in_cols, count_patients_with_event, count_patients_with_flags, count_values, estimate_multinomial_response, estimate_proportion, h_tab_one_biomarker, estimate_incidence_rate, logistic_summary_by_flag, estimate_odds_ratio, estimate_proportion_diff, test_proportion_diff, summarize_ancova, summarize_change, summarize_glm_count, summarize_num_patients, analyze_num_patients, summarize_patients_exposure_in_cols, coxph_pairwise, tabulate_survival_subgroups, surv_time, and surv_timepoint.

Enhancements

  • Added formatting function format_count_fraction_lt10 for formatting count_fraction with special consideration when count is less than 10.
  • Updated s_summary.logical output for count_fraction when denominator is zero to display as NA instead of 0 in tables.
  • Updated analyze_vars_in_cols to allow character input to indicate whether nominal time point is post-dose or pre-dose when applying the 1/3 imputation rule.

Bug Fixes

  • Fixed bug in g_km causing an error when converting certain annotation width units.

Miscellaneous

  • Began deprecation of na_level argument in s_count_abnormal_by_baseline, a_summary, analyze_vars, analyze_vars_in_cols, compare_vars, h_map_for_count_abnormal, h_stack_by_baskets, summarize_colvars, a_coxreg, and summarize_coxreg and replaced it with the na_str argument.

What's Changed

Full Changelog: v0.9.1...v0.9.2

v0.9.1

04 Oct 18:55
536a69a
Compare
Choose a tag to compare

New Features

  • Added imputation_rule function to apply imputation rule to data.
  • Added new format function format_sigfig to allow for numeric value formatting by a specified number of significant figures.
  • Added vectors containing default statistic formats and labels as tern_default_formats and tern_default_labels, respectively.
  • Added function get_stats to return methods from given statistical method groups.
  • Added function get_formats_from_stats to return formats and get_labels_from_stats to return labels for a given set of statistics.
  • Added "auto" option for .formats. It uses format_auto to determine automatically the number of digits.
  • Added title argument to h_grob_tbl_at_risk and annot_at_risk_title argument to g_km and h_km_layout which allows user to add "Patients at Risk" title to Kaplan-Meier at risk annotation table.

Enhancements

  • Refactored tabulate_rsp_subgroups to pass sanitation checks by preventing creation of degenerate subtables.
  • Updated analyze_vars_in_cols to use caching, allow implementation of imputation rule via the imp_rule argument, and allow user to specify cell alignment via the .aligns argument.
  • Updated add_rowcounts to allow addition of row counts from alt_counts_df using the alt_counts argument.
  • Added gp argument to g_forest to control graphical parameters such as font size.

Miscellaneous

  • Grouped functions relating to valid method names and their default formats and labels into new source file utils_defaults_handling.R.
  • Started deprecation of summary_custom() and a_summary() as a S3 method.
  • Renamed statistical method for p-value in the discrete case to pval_counts.
  • Removed a_summary_internal() in favor of only one main a_summary().

What's Changed

  • Refactor tabulate_rsp_subgroups to pass sanitation checks by @edelarua in #1056
  • Add helper functions to refactor PKCT01 by @edelarua in #1048
  • Reorganize and group defaults for stats and their default formats/labels -> addition of auto for DMT01 by @Melkiades in #1051
  • Close #1026: Expose gpar to control graphic settings in g_forest. by @anajens in #1057
  • Change to poisson dist to see if it is the glm fit to be unstable by @Melkiades in #1059
  • Add "Patients at Risk" title for g_km at risk annotation table by @edelarua in #1065
  • Fix trailing "." when using format_sigfig, add functionality for multiple values by @edelarua in #1067
  • Fix snapshot differences (it may need muting h_ppmeans()) by @Melkiades in #1072
  • [skip vbump] release v0.9.1 by @Melkiades in #1074

Full Changelog: v0.9.0...v0.9.1

v0.9.0

01 Sep 11:40
95158c9
Compare
Choose a tag to compare

New Features

  • Added stat_propdiff_ci function to calculate proportion/risk difference and CI.
  • Added risk difference column functionality via the riskdiff argument to functions count_occurrences, count_occurrences_by_grade, count_patients_with_event, count_patients_with_flags, analyze_num_patients, and summarize_num_patients.

Enhancements

  • Refactored the function a_summary to no longer use the helper function create_afun_summary.
  • Refactored functions summarize_vars and compare_vars to use the refactored a_summary function.
  • Created new internal helper functions ungroup_stats to ungroup statistics calculated for factor variables, and a_summary_internal to perform calculations for a_summary.

Bug Fixes

  • Fixed bug in s_count_occurrences_by_grade so that "missing" grade always appears as the final level.
  • Fixed bug in analyze_vars_in_cols when categorical data was used.
  • Fixed bug in s_count_occurrences_by_grade so that levels are not relabeled when reordering to account for "missing" grades.

Miscellaneous

  • Fixed swapped descriptions for the .N_row and .N_col parameters.
  • Removed internal calls to df_explicit_na. Changes in NA values should happen externally to tern functions, depending on users' needs.
  • Reinstated correct soft deprecation for create_afun_summary and create_afun_compare.

What's Changed

Full Changelog: v0.8.5...v0.9.0

v0.8.5

24 Jul 03:31
318b1e1
Compare
Choose a tag to compare

Enhancements

  • Added ylim argument to g_km to allow the user to set custom limits for the y-axis.
  • Added assertion to g_km which checks whether there is one arm present in the data when annot_coxph is true.
  • Added flag_labels argument to s_count_patients_with_flags to enable more label handling options in count_patients_by_flags.

Miscellaneous

  • Started deprecation cycle for summarize_vars and control_summarize_vars. Renamed into analyze_vars and control_analyze_vars to reflect underlying rtables machinery while keeping backward compatibility with aliases.

What's Changed

  • Workflow propagations by @walkowif in #991
  • summarize_vars renamed into analyze_vars and aliases + deprecation cycle by @Melkiades in #982
  • Add ylim argument to g_km by @edelarua in #1001
  • Improve error message in g_km for single arm when annot_coxph=TRUE by @edelarua in #998
  • Enable more flexible labelling in count_patients_with_flags by @edelarua in #1005
  • tlg-catalog no longer contains staged.dependencies. by @gogonzo in #1007
  • update news vbump to 0.8.5, [skip vbump] by @shajoezhu in #1008

Full Changelog: v0.8.4...v0.8.5

v0.8.4

27 Jun 14:35
2b3189f
Compare
Choose a tag to compare

Enhancements

  • Added method for character class to h_coxreg_inter_effect enabling character covariates in summarize_coxreg.

Miscellaneous

  • Began deprecation of time_unit_input and time_unit_output arguments and replaced them with the input_time_unit and num_pt_year, respectively, in control_incidence_rate.
  • Removed deprecated pairwise function.

Bug fixes

  • Fixed long double assertion check in sum(weights) for M1mac installation.

What's Changed

  • reduce the amount of spelling issues / WORDLIST by @m7pr in #971
  • More intuitive parameter names in control_incidence_rate by @edelarua in #975
  • Add character method to h_coxreg_inter_effect by @edelarua in #974
  • Failure fix for M1mac and noLD - long double problems for sum(weights) by @Melkiades in #981
  • Update snapshots to fix autovalidate tests by @edelarua in #986
  • Fix tests - deprecate pairwise and add another test for format_count_fraction by @edelarua in #987
  • updating news, preping for cran release v0.8.4 [skip vbump] by @shajoezhu in #989

New Contributors

  • @m7pr made their first contribution in #971

Full Changelog: v0.8.3...v0.8.4

v0.8.3

20 Jun 07:50
c69a6f7
Compare
Choose a tag to compare

Enhancements

  • Added explicit zero counts to g_km plot "at risk" annotation tables.
  • Added a flag for total level split in analyze_patients_exposure_in_cols.
  • Implemented .indent_mods argument in functions h_tab_one_biomarker, h_tab_rsp_one_biomarker, h_tab_surv_one_biomarker, summarize_logistic, logistic_summary_by_flag, tabulate_rsp_biomarkers, a_coxreg, summarize_coxreg, tabulate_survival_biomarkers, surv_time, surv_timepoint, and cfun_by_flag.
  • Updated summarize_coxreg to print covariates in data rows for univariate Cox regression with no interactions and content rows otherwise.
  • Removed "baseline status" text from d_count_abnormal_by_baseline labels.
  • Improved default sizing of annotation tables in g_km and added dynamic scaling of the surv_med and coxph annotation tables, with customization via the width_annots argument.

Bug Fixes

  • Fixed bug in split_text_grob preventing titles and footnotes from being properly formatted and printed by decorate_grob.
  • Fixed bug in g_lineplot preventing lines from being added to the plot when midpoint statistic calculations result in NA value(s).
  • Fixed tern:::tidy.glm formals to respect broom:::tidy.default formals.

Miscellaneous

  • Remove examples for unexported functions.
  • Export functions has_count_in_cols, has_counts_difference, combine_counts, h_tab_rsp_one_biomarker, arrange_grobs, a_count_patients_sum_exposure, a_coxreg, groups_list_to_df, forest_viewport.
  • Updated README to include installation instructions for CRAN.
  • Began deprecation of indent_mod argument and replace it with the .indent_mods argument in summarize_num_patients and analyze_num_patients.

What's Changed

Full Changelog: v0.8.1...v0.8.3