Releases: insightsengineering/tern
Releases · insightsengineering/tern
v0.8.2
Breaking Changes
- Refactored
s_coxreg
andsummarize_coxreg
to work with new analysis functiona_coxreg
.
Bug Fixes
- Fixed missing label for
TRTEDTM
intern
datasets. - Fixed improper implementation of
na_level
argument insummarize_vars
preventing it from having an effect.
Enhancements
- Added
section_div
andna_level
arguments tosummarize_vars
. - Added
median_range
as a numeric variable statistic option forsummarize_vars
. - Corrected ordering of factor levels by
d_onco_rsp_label
. - Added new "Analyze Functions", "Summarize Functions", and "Analyze Functions on Columns" overview pages.
- Consolidated all KM plot documentation within the
g_km
function. - Added
a_count_patients_sum_exposure
forsummarize_patients_exposure_in_cols
and new analyze functionanalyze_patients_exposure_in_cols
. - Added more informative error when the user selects an invalid method for unstratified analyses in
s_proportion_diff
.
Miscellaneous
- Implemented the
lubridate
package for date variables intern
datasets. - Organized
.gitignore
and.Rbuildignore
files. - Removed deprecated
footnotes
functions and all related files. - Started deprecation cycle for
pairwise
function. - Moved
count_patients_with_flags
functions fromcount_patients_with_event.R
tocount_patients_with_flags.R
.
What's Changed
- Use
argument_convention
instead of templates by @edelarua in #870 - moving out data generator script from user-facing doc by @Melkiades in #868
- Organization of ignores by @Melkiades in #872
- Remove deprecated footnotes functions by @edelarua in #875
- Fix tibble snapshots by @edelarua in #878
- 858 missing values vignette by @Nolan-Steed in #876
- fixing argument convention and adding section_div to summarize_vars by @Melkiades in #881
- Workflow updates by @walkowif in #877
- Add
median_range
as a statistic option forsummarize_vars
by @edelarua in #884 - Refactor cox regression functions to fix table structure by @edelarua in #882
- Fix
a_coxreg
bug for univariate case with no arm and numeric covariate by @edelarua in #892 - Fix GRAN build errors by @edelarua in #894
- alphabetical order of staged.deps + biomarker-catalog by @Melkiades in #895
- Update token name by @walkowif in #897
- Add Value documentation for all functions by @edelarua in #896
- deprecating
pairwise
by @Melkiades in #902 - Update level order in
d_onco_rsp_label
by @edelarua in #904 - Move
count_patients_with_flags
functions into a separate file by @edelarua in #907 - Check all URLs by @edelarua in #909
- Update overview pages by @edelarua in #908
- Add
analyze_patients_exposure_in_cols
by @edelarua in #916 - Clean up documentation by @edelarua in #914
- Add more informative error to
s_proportion_diff
by @edelarua in #922 - Fix
na_level
bug insummarize_vars
by @edelarua in #923 - Check tests after formatters' changes by @Melkiades in #912
- fixing both validation errors by @Melkiades in #927
Full Changelog: v0.8.1...v0.8.2
v0.8.1
Bug Fixes
- Fixed missing label for
TRTEDTM
intern
datasets.
Miscellaneous
- Implemented the
lubridate
package for date variables intern
datasets.
What's Changed
- Fix dates in
tern
data [skip vbump] by @edelarua in #861 - Fix missing label for
TRTEDTM
intern
data [skip vbump] by @edelarua in #863 - [skip vbump] replacing version from 0.8.0 to 0.8.1 by @shajoezhu in #864
Full Changelog: v0.8.0...v0.8.1
v0.8.0
Enhancements
- Added
summarize_glm_count
function to analyze count data using a linear model. - Added legend to
g_step
. - Added formatting functions
format_fraction_fixed_dp
and
format_count_fraction_fixed_dp
with fixed single decimal place in percentages. - Added
na_level
andlabelstr
arguments tosummarize_vars_in_cols
. - Added
analyze_num_patients
to include summary at the beginning that does not
repeat when paginating. - Added
h_row_first_values
function as a more general helper function to retrieve
first values from specific rows. - Added option to remove
"(n)"
suffix fromunique_count
labels fors_num_patients
. - Added options to
g_km
to annotate with statistics (annot_stats
) and add corresponding
vertical lines (annot_stats_lines
).
Bug Fixes
- Fixed bug causing incorrect ordering of numeric grade levels when missing
grades are present ins_count_occurrences_by_grade
. - Refactored
summarize_vars_in_cols
to work with pagination machinery. - Fixed bug to allow passing of
conf_level
argument toemmeans::contrast()
ins_ancova
. - Fixed bugs in
rtables_access.R
caused by not checking for specific combinations
(also the standard values that were never used) of column indices and names. - Fixed single applicable record bug in
count_abnormal_by_grade
. - Fixed bug in
add_rowcounts
that caused all row count row values to count as zero. - Fixed bug in
h_col_indices
causing an error when pruning with combination columns. - Fixed bug in
test_proportion_diff
missing argument forvar_labels
.
Documentation and Tests
- Added more tests to increase code coverage.
- Created separate documentation files for functions in different sections of pkgdown reference.
- Created separate
.R
files for logistic regression and cox regression helper functions. - Fixed table tests using
analyze_num_patients
to generate an initial summary so there is no
repetition when paginating. - Updated tests to use
testthat
3rd edition and replaced applicable tests with snapshot testing. - Updated
summarize_ancova
examples to useiris
dataset instead ofscda
data. - Created vignette which saves cached synthetic CDISC dataset files to the
data/
folder and
generated cached synthetic datasets. - Updated all examples/tests to use datasets from the
data/
folder instead ofscda
datasets. - Removed all template tests from
tern
. These tests are in internal reposcda.test
.
Miscellaneous
- Renamed
summarize_vars_in_cols
toanalyze_vars_in_cols
to reflect the appropriateanalyze
logic. - Removed redundant
summary_in_cols
helper functions. - Exported function
format_xx
. - Replaced deprecated
ggplot2
functions/arguments to fix warnings. - Replaced deprecated function
forcats::fct_explicit_na
withforcats::fct_na_value_to_level
. - Removed deprecated
wrap_text
function and related files. - Started deprecation cycle for
footnotes
functions.
What's Changed
- Update
scda
data by @edelarua in #728 - 713
summarize_occurrences_by_grade
missing numeric grades bug by @edelarua in #729 - adding tern.gee to staged.deps by @shajoezhu in #731
- 733 Add more tests to
tern
by @edelarua in #734 - added deprecated badge by @Melkiades in #735
- Add coverage badge by @walkowif in #737
- added legend to g_step plot by @sob2021 in #732
- Enable checks for
workflow_dispatch
event by @walkowif in #738 - 401 add rate01 tlg@main by @ayogasekaram in #739
- 740 qplot warning failure@main by @Melkiades in #741
- citril dep by @pawelru in #745
- Fix tests by @Melkiades in #750
- add warning for negative binomial. Increase test coverage. by @ayogasekaram in #746
- Adding test to improve code coverage. by @ayogasekaram in #753
- 754 Add formatting function with fixed single decimal place by @edelarua in #755
- set count_fraction default format to format_count_fraction by @shajoezhu in #758
- 744 Fix
h_glm_negbin
note by @edelarua in #760 - Complete pkct01 by @Melkiades in #756
- rename summarize vars in cols by @Melkiades in #766
- 720 Remove
replace_emptys_with_na
by @edelarua in #768 - Badges and contribution guidelines by @insights-engineering-bot in #769
- update conf_level passing in s_ancova by @JiaLiu0001 in #772
- Add ADAT03 test by @edelarua in #774
- 773 export format xx by @shajoezhu in #775
- Create
analyze_num_patients
and correct ae* tables by @Melkiades in #776 - 788 Fix formats and resolve test warnings by @edelarua in #789
- expand score occurrences by @Melkiades in #787
- fix summarize occurrences by grade for pagination by @Melkiades in #790
- 786 Add tests for PDT01 and PDT02 by @edelarua in #791
- Fixing sorting in
count_occurence_by_grade()
tests by @Melkiades in #794 - 759 document formats@main by @Nolan-Steed in #795
- 799 Fix
summarize_num_patients
labels by @edelarua in #800 - Create test snapshots & upgrade to
testthat
3rd edition by @edelarua in #801 - fixing g_forest for older versions of testthat by @Melkiades in #803
- Add option to remove
(n)
suffix ins_num_patients
by @edelarua in #806 - Fix pkgdown site references by @edelarua in #804
- Update
summarize_ancova
examples to useiris
data by @edelarua in #809 - Create minimal data and update examples by @edelarua in #808
- Update tests to use snapshots and use
tern
data by @edelarua in #813 - Remove template tests from
tern
by @edelarua in #816 - Fix
tern
staged deps by @edelarua in #819 - Replace deprecated
forcats::fct_explicit_na
by @edelarua in #817 - Reintroducing tests for
g_lineplot
by @Melkiades in #822 - Deprecate footnotes and removing wrap_text by @Melkiades in #826
- Check as-cran + default landing page by @arkadiuszbeer in #823
- Fix bugs in
count_abnormal_by_worst_grade
andsummarize_num_patients
by @edelarua in #828 - Potential fix for GRAN error by @edelarua in #830
- Add options to annotate
g_km
with statistics/vertical lines by @edelarua in #829 - Apply styler to all remaining
tern
code by @edelarua in #833 - Add data labels, fix footnote function warnings by @edelarua in #835
- updated rtables staged dep by @ayogasekaram in #837
- Tidy Roxygen documentation (newlines & bullet lists) by @edelarua in #838
- update version from rtables and formatters by @shajoezhu in #840
- Fix bug in
add_rowcounts
by @edelarua in #843 - Fix column name bug in
h_col_indices
by @edelarua in #845 - Fix broken link to
rtables
vignette by @HenningLorenzen-ext-bayer in #847 - Update README.md by @pawelru in #848
- Added var_labels argument by @Nolan-Steed in #853
- Prepare for v0.8.0 release [skip vbump] by @edelarua in #855
New Contributors
- @walkowif made their first contribution in #737
- @sob2021 made their first contribution in #732
- @HenningLorenzen-ext-bayer made their first contribution in #847
Full Changelog: v0.7.10...v0.8.0
v0.7.10
New Features
- Added stratified Newcombe and stratified Wilson statistics to
estimate_proportion
and
estimate_proportion_diff
with relative tests. - Added
stat_mean_pval
, a new summary statistic to calculate the p-value of
the mean. - Added statistic
mean_se
(mean with standard error) forsummarize_variables
and related functions. - Introduced again
Rdpack
for references.
Enhancements
- Redesign of data handling in tests by removing repetitive data loads and
library calls. - Added
DescTools::BinomDiffCI
function withintern
. - Added new parameter to
summarize_logistic
to specify which pivoted value
to use during analysis. - Updated
s_coxph_pairwise
to generate log-rank p-value using original
log-rank test instead of Cox Proportional-Hazards Model. - Implemented
nestcolor
in all examples by adaptingg_km
,g_ipp
,
g_waterfall
,g_step
,g_lineplot
, andg_forest
. - Added parameters
interaction_y
andinteraction_item
in ANCOVA to make the
interaction calculations available. - Added new parameter
footnotes
to add footnotes tog_km
.
Migration from assertthat
to checkmate
- Implemented
checkmate::assert_vector
,checkmate::assert_set_equal
, and
checkmate::assert_int
to check vector type, length, and values. - Replaced with standard assertions from
checkmate
the following functions:
all_elements_in_ref
,is_df_with_nlevels_factor
,is_df_with_no_na_level
,
is_proportion_vector
,is_quantiles_vector
,is_character_or_factor
,
is_nonnegative_count
,is_valid_character
,assert_character_or_factor
,
assert_equal_length
andhas_tabletree_colnames
. - Modified
is_proportion
,is_equal_length
,is_df_with_no_na_level
,
is_df_with_nlevels_factor
,is_variables
,is_df_with_variables
,
is_df_with_factors
,is_valid_factor
to use assertion logic. - Added more verbose warnings from
as_factor_keep_attributes
. - Made
assert_df_with_factors
andassert_proportion_value
internal functions. - Renamed
assertthat.R
andtest-assertthat.R
toutils_checkmate.R
and
test-utils_checkmate.R
.
Documentation and NAMESPACE Polishing
- Added stable badges for:
count_abnormal_by_marked
(reference toabnormal_by_marked
),
count_abnormal_lab_worsen_by_baseline
andh_adlb_worsen
(reference to
abnormal_by_worst_grade_worsen_from_baseline
),count_abnormal_by_worst_grade
(reference toabnormal_by_worst_grade
),to_string_matrix
,tidy.summary.coxph
,tidy.step
,
surv_timepoint
, (reference tosurvival_timepoint
),surv_time
(reference tosurvival_time
),
coxph_pairwise
(reference tosurvival_coxph_pairwise
),
extract_survival_subgroups
andtabulate_survival_subgroups
(reference tosurvival_duration_subgroups
),
extract_survival_biomarkers
andtabulate_survival_biomarkers
(reference to
survival_biomarkers_subgroups
),control_summarize_vars
,s_summary
and
a_summary
(reference tosummarize_variables
) and kept the S3 method tree.summarize_patients_exposure_in_cols
,summarize_num_patients
with
s_num_patients
,s_num_patients_content
,summarize_num_patients
.count_cumulative
,count_missed_doses
,count_patients_events_in_cols
,summarize_colvars
,summarize_change
,summarize_ancova
,as.rtable
,color_palette
,add_footnotes
.- (statistical function controls)
control_coxreg
,control_coxph
,
control_incidence_rate
,control_lineplot_vars
,control_surv_time
,
control_surv_timepoint
,control_logisitic
,control_step
. stat_mean_ci
,stat_median_ci
,split_cols_by_groups
,explicit_na
,sas_na
,extract_rsp_subgroups
,tabulate_rsp_subgroups
,extract_rsp_biomarkers
,
tabulate_rsp_biomarkers
,keep_rows
,keep_content_rows
,has_count_in_any_col
,
has_fraction_in_cols
,has_fraction_in_any_col
,has_fractions_difference
,
test_proportion_diff
,pairwise
,logistic_regression
,
estimate_incidence_rate
,control_incidence_rate
(reference to
incidence_rate
),cut_quantile_bins
,
estimate_multinomial_rsp
,decorate_grob_set
,extreme_format
,fit_rsp_step
,
fit_survival_step
,footnotes
,footnotes-set
,
format_count_fraction
,format_fraction_threshold
,formatting_functions
,
format_fraction
,combination_function
(S4 method),compare_variables
(S3 method),
kaplan_meier
.
- Internal keywords added, export removed,
_pkgdown.yml
updated, andtern:::
added for
tests/examples/vignettes where present for the following functions:- (chain functions, reference to
abnormal_by_marked
)s_count_abnormal_by_marked
,
a_count_abnormal_by_marked
. - (chain functions, reference to
abnormal_by_worst_grade_worsen_from_baseline
)
a_count_abnormal_lab_worsen_by_baseline
,s_count_abnormal_lab_worsen_by_baseline
. - (chain functions, reference to
abnormal_by_worst_grade
)s_count_abnormal_by_worst_grade
,
a_count_abnormal_by_worst_grade
. - (chain functions, reference to
survival_timepoint
)s_surv_timepoint
,s_surv_timepoint_diff
,
a_surv_timepoint
,a_surv_timepoint_diff
. - (chain functions, reference to
survival_time
)s_surv_time
,a_surv_time
. - (chain functions, reference to
survival_coxph_pairwise
)s_coxph_pairwise
,a_coxph_pairwise
. - (chain functions, reference to
survival_duration_subgroups
)a_survival_subgroups
. - (chain functions, reference to
count_cumulative
)s_count_cumulative
,a_count_cumulative
. - (chain functions, reference to
count_missed_doses
)s_count_nonmissing
,s_count_missed_doses
,a_count_missed_doses
. - (chain functions, reference to
count_patients_events_in_cols
)s_count_patients_and_multiple_events
,summarize_patients_events_in_cols
. - (chain functions, reference to
incidence_rate
)s_incidence_rate
,a_incidence_rate
. - (cox regression helper)
cox_regression_inter
,decorate_grob_factory
,draw_grob
,estimate_coef
. summary_labels
,summary_formats
,s_count_patients_sum_exposure
,
a_change_from_baseline
s_change_from_baseline
,a_ancova
,s_ancova
,arrange_grobs
,as_factor_keep_attributes
,combine_levels
,split_text_grob
,
groups_list_to_df
,s_cox_multivariate
,is_leaf_table
,a_response_subgroups
,range_noinf
,has_count_in_cols
,
has_counts_difference
,prop_chisq
,prop_cmh
,prop_schouten
,prop_fisher
,
s_test_proportion_diff
,a_test_proportion_diff
,fct_discard
,fct_explicit_na_if
.
- (chain functions, reference to
Bug Fixes
- Fixed retrieval method of
stats::ancova
output due to version inconsistency. - Fixed tests to respect the new standard print for
NA
coming fromrtables
. - Fixed error in tests coming from changes in
formatters::var_labels
. - Fixed
prop_diff
functions to respect success responses (TRUE
values). - Fixed error coming from comparing factors vector to characters vector.
- Fixed empty vector exception for
cut_quantile_bins
. - Fixed exception error when empty strings are present in pivoted columns (
rtables
split
functions) - Fixed bug in
s_ancova
causing an error when the first level of the arm
factor is not the control arm. - Fixed bug in
s_abnormal_by_worst_grade
when there is onePARAM
level. - Fixed bug in
prop_diff_wald
when selecting all responders, updated tests accordingly. - Fixed bug in
h_ancova
that caused an error when deselecting all covariates.
Miscellaneous
- Added deprecated badge to
g_mmrm
. - Removed internal function calls in examples (
tern:::
) and addeddontrun
to internal function examples. - Removed warnings and messages to console occurring in examples and tests.
- Deprecated functions
color_palette
andh_set_nest_theme
in favor of
nestcolor::color_palette
andnestcolor::theme_nest
, respectively. - Removed deprecated functions:
color_palette
,color_palette_core
,
h_set_nest_theme
,s_cox_univariate
. - Removed deprecated
mmrm
functions:fit_mmrm
,g_mmrm_diagnostic
,
g_mmrm_lsmeans
,as.rtable.mmrm
,h_mmrm_fixed
,h_mmrm_cov
,
h_mmrm_diagnostic
,tidy.mmrm
,s_mmrm_lsmeans
,s_mmrm_lsmeans_single
,
summarize_lsmeans
. - Renamed functions
arm
tostudy_arm
andextract
toextract_by_name
. - Renamed
rtables.R
toutils_rtables.R
. - Extracted
cox_regression_inter
into a separate file fromcox_regression
. - Renamed
estimate_incidence_rate.R
toincidence_rate.R
to match the documentation grouping name. - Extracted
control_incidence_rate
into a separate file because it produces a separate documentation file. - Added
@md
and removed@order
fromincidence_rate.R
. Modified examples accordingly. - Removed hyperlink from
prop_schouten
function documentation. - Exported
draw_grob
function.
What's Changed
- 683 fix test var labels changes@main by @Melkiades in #684
- 687 fix from formatters na str@main by @Melkiades in #690
- add param 'interacton_y' and 'interaction_item' to get the interactio… by @JiaLiu0001 in #688
- 692 Fix count_abnormal_by_worst_grade PARAM bug by @edelarua in #693
- 694 fix stats ancova old versions@main by @Melkiades in #695
- fix R CMD as-cran by @nikolas-burkoff in #699
- 698 Remove deprecated
tern
functions by @edelarua in #701 - 588 adding stratified newcombe@main by @Melkiades in #696
- Update check.yaml by @arkadiuszbeer in #685
- 705 Fix
nestcolor
CRAN check note by @edelarua in #706 - Generalize data handling in te...
v0.7.9
Enhancements
- Added
DescTools
BinomDiffCI
function withintern
. - Exported
draw_grob
function. - Added new parameter to
summarize_logistic
to specify which pivoted value should be removed during analysis. - Updated
s_coxph_pairwise
to generate log-rank p-value using original log-rank test instead
of Cox Proportional-Hazards Model. - Added more verbose warnings from
as_factor_keep_attributes
for bettertest_examples()
readability. - Implemented
nestcolor
in all examples, with slight refactoring tog_km
,g_ipp
,
g_waterfall
,g_step
,g_lineplot
, andg_forest
. - Added
stat_mean_pval
function to calculate the p-value of the mean as a new summary statistic. - New statistic
mean_se
(mean with standard error) forsummarize_variables()
and related functions.
Migration from assertthat
to checkmate
- Substituted all
assertthat
calls withcheckmate
. - Implemented
checkmate::assert_vector()
,checkmate::assert_set_equal()
, and
checkmate::assert_int()
to validate vector type, length, and input. - Made
assert_df_with_factors
andassert_proportion_value
internal functions. - Removed assertion functions
all_elements_in_ref
,is_df_with_nlevels_factor
,
is_df_with_no_na_level
,is_proportion
,is_proportion_vector
,is_quantiles_vector
,
is_valid_character
,
assert_character_or_factor
,assert_equal_length
andhas_tabletree_colnames
. - Renamed
is_proportion
toassert_proportion_value
. - Renamed
is_equal_length
toassert_equal_length
. - Refactored
assert_df_with_variables
to replaceis_df_with_no_na_level
. - Refactored
assert_df_with_factors
to replaceis_df_with_nlevels_factor
. - Replaced usage of
is_quantiles_vector
andall_elements_in_ref
withcheckmate::subset()
. - Replaced
is_character_or_factor
withcheckmate::assert_multi_class()
. - Replaced
is_nonnegative_count
withcheckmate::assert_count()
. - Replaced
is_variables
withassert_list_of_variables
. - Replaced
is_df_with_variables
withassert_df_with_variables
. - Replaced
is_df_with_factors
withassert_df_with_factors
. - Replaced
is_valid_factor
withassert_valid_factor
. - Renamed
assertthat.R
toutils_checkmate.R
. - Renamed
test-assertthat.R
totest-utils_checkmate.R
.
Bug Fixes
- Identified bug in
prop_diff
functions. Coding of responses have been corrected (TRUE is a success). - Fixed error coming from comparing factors vector to characters vector.
- Fixed empty vector test for
cut_quantile_bins
. - Fixed bug related to error flag for empty strings coming from
rtables
split
functions. Creation ofreplace_emptys_with_na
to replace empty strings with
custom strings across data.frame (this can be merged withdf_explicit_na
). - Fixed warnings occurring in example tests.
- Fixed internal function examples errors by removing
tern:::
prefix and addeddontrun
to internal function examples. - Fixed bug in
s_ancova
causing an error when the first level of the arm factor is not the control arm.
Documentation and NAMESPACE Polishing
- Added stable badges for:
count_abnormal_by_marked
(reference toabnormal_by_marked
),
count_abnormal_lab_worsen_by_baseline
andh_adlb_worsen
(reference to
abnormal_by_worst_grade_worsen_from_baseline
),count_abnormal_by_worst_grade
(reference toabnormal_by_worst_grade
),to_string_matrix
,tidy.summary.coxph
,tidy.step
,
surv_timepoint
, (reference tosurvival_timepoint
),surv_time
(reference tosurvival_time
),
coxph_pairwise
(reference tosurvival_coxph_pairwise
),
extract_survival_subgroups
andtabulate_survival_subgroups
(reference tosurvival_duration_subgroups
),
extract_survival_biomarkers
andtabulate_survival_biomarkers
(reference to
survival_biomarkers_subgroups
),control_summarize_vars
,s_summary
and
a_summary
(reference tosummarize_variables
) and kept the S3 method tree.summarize_patients_exposure_in_cols
,summarize_num_patients
with
s_num_patients
,s_num_patients_content
,summarize_num_patients
.count_cumulative
,count_missed_doses
,count_patients_events_in_cols
,summarize_colvars
,summarize_change
,summarize_ancova
,as.rtable
,color_palette
,add_footnotes
.- (statistical function controls)
control_coxreg
,control_coxph
,
control_incidence_rate
,control_lineplot_vars
,control_surv_time
,
control_surv_timepoint
,control_logisitic
,control_step
. stat_mean_ci
,stat_median_ci
,split_cols_by_groups
,explicit_na
,sas_na
,extract_rsp_subgroups
,tabulate_rsp_subgroups
,extract_rsp_biomarkers
,
tabulate_rsp_biomarkers
,keep_rows
,keep_content_rows
,has_count_in_any_col
,
has_fraction_in_cols
,has_fraction_in_any_col
,has_fractions_difference
,
test_proportion_diff
,pairwise
,logistic_regression
,
estimate_incidence_rate
,control_incidence_rate
(reference to
incidence_rate
),cut_quantile_bins
,d_pkparam
,
estimate_multinomial_rsp
,decorate_grob_set
,extreme_format
,fit_rsp_step
,
fit_survival_step
,footnotes
,footnotes-set
,
format_count_fraction
,format_fraction_threshold
,formatting_functions
,
format_fraction
,combination_function
(S4 method),compare_variables
(S3 method),
h_stack_by_baskets
,h_pkparam_sort
,h_adsl_adlb_merge_using_worst_flag
,kaplan_meier
.
- Internal keywords added, export removed,
_pkgdown.yml
updated, andtern:::
added for
tests/examples/vignettes where present for the following functions:- (chain functions, reference to
abnormal_by_marked
)s_count_abnormal_by_marked
,
a_count_abnormal_by_marked
. - (chain functions, reference to
abnormal_by_worst_grade_worsen_from_baseline
)
a_count_abnormal_lab_worsen_by_baseline
,h_worsen_counter
(same file),
s_count_abnormal_lab_worsen_by_baseline
. - (chain functions, reference to
abnormal_by_worst_grade
)s_count_abnormal_by_worst_grade
,
a_count_abnormal_by_worst_grade
. - (chain functions, reference to
survival_timepoint
)s_surv_timepoint
,s_surv_timepoint_diff
,
a_surv_timepoint
,a_surv_timepoint_diff
. - (chain functions, reference to
survival_time
)s_surv_time
,a_surv_time
. - (chain functions, reference to
survival_coxph_pairwise
)s_coxph_pairwise
,a_coxph_pairwise
. - (chain functions, reference to
survival_duration_subgroups
)a_survival_subgroups
. - (chain functions, reference to
count_cumulative
)h_count_cumulative
,
d_count_cumulative
,s_count_cumulative
,a_count_cumulative
. - (chain functions, reference to
count_missed_doses
)s_count_nonmissing
,d_count_missed_doses
,s_count_missed_doses
,a_count_missed_doses
. - (chain functions, reference to
count_patients_events_in_cols
)s_count_patients_and_multiple_events
,summarize_patients_events_in_cols
. - (chain functions, reference to
incidence_rate
)h_incidence_rate_normal
,
h_incidence_rate_normal_log
,h_incidence_rate_exact
,h_incidence_rate_byar
,
h_incidence_rate
,s_incidence_rate
,a_incidence_rate
. - (cox regression helper)
cox_regression_inter
,decorate_grob_factory
,draw_grob
,estimate_coef
. - (reference to
h_survival_duration_subgroups
)h_survtime_df
,h_survtime_subgroups_df
,h_coxph_df
,h_coxph_subgroups_df
- (reference to
h_survival_biomarkers_subgroups
)h_surv_to_coxreg_variables
,
h_coxreg_mult_cont_df
,h_tab_surv_one_biomarker
. - (reference to
h_step
)h_step_window
,h_step_trt_effect
,h_step_survival_formula
,
h_step_survival_est
,h_step_rsp_formula
,h_step_rsp_est
. - (reference to
h_response_biomarkers_subgroups
)h_rsp_to_logistic_variables
,
h_logistic_mult_cont_df
,h_tab_rsp_one_biomarker
. summary_labels
,summary_formats
,s_count_patients_sum_exposure
,
a_change_from_baseline
s_change_from_baseline
,a_ancova
,s_ancova
,h_ancova
,
arrange_grobs
,as_factor_keep_attributes
,combine_levels
,split_text_grob
,
groups_list_to_df
,s_cox_multivariate
,h_row_counts
,h_row_fractions
,h_col_counts
,is_leaf_table
,
h_content_first_row
,a_response_subgroups
,range_noinf
,has_count_in_cols
,
has_counts_difference
,prop_chisq
,prop_cmh
,prop_schouten
,prop_fisher
,
s_test_proportion_diff
,a_test_proportion_diff
,h_split_param
,
fct_discard
,fct_explicit_na_if
.
- (chain functions, reference to
- Added deprecated badge to
g_mmrm
. - Removed
tern:::
prefix from internal function uses in tests. - Reverted
fct_collapse_only
,month2day
, andday2month
to export. - Reverted all
d_
andh_
functions to export, allowing users to utilize their flexibility. - Renamed
rtables.R
as file name is confusing due to the package dependence. - Renamed files to reflect main documented function and fixed
R
files starting with the word test
not complying with the standard. - Extracted
cox_regression_inter
into a separate file fromcox_regression
. - Renamed
estimate_incidence_rate.R
toincidence_rate.R
to match the documentation grouping name. - Extracted
control_incidence_rate
into a separate file as it was exported and documented separately. - Added
@md
and removed@order
fromincidence_rate.R
. Modified examples accordingly. - Removed hyperlink from
prop_schouten
function documentation.
Miscellaneous
- Deprecated the
color_palette
function withnestcolor::color_palette
and removedcolor_palette_core
. - Deprecated
h_set_nest_theme()
in favor ofnestcolor::theme_nest()
. - Removed deprecated
mmrm
functions:fit_mmrm
,g_mmrm_diagnostic
,g_mmrm_lsmeans
,as.rtable.mmrm
,h_mmrm_fixed
,
h_mmrm_cov
,h_mmrm_diagnostic
,tidy.mmrm
,s_mmrm_lsmeans
,s_mmrm_lsmeans_single
,summarize_lsmeans
. - Renamed functions
arm
tostudy_arm
andextract
toextract_by_name
.
v0.7.8
Enhancements
- Enhanced
g_lineplot
with additional table to automatically scale the table height and return aggplot
object. - Enhanced
g_ipp
with additional caption argument and adjust the position. - Enhanced
prop_diff
tern
function and related functions to be able to apply a continuity correction in the Newcombe method. - Enhanced
summarize_numeric_in_columns
andsummarize_variables
to allow factor/character summary and to be able to summarize the number ofBLQs
inAVALC
fromADPC
dataset. - Updated order of summarize variables stats in manual for order consistency.
- Added a
sum
option tosummarize_variables
. - Use consistent color palette for plotting (
stream
by default). - Enhanced
h_pkparam_sort
function with additional argumentkey_var
to allow data with different column names.
Miscellaneous
- Updated
test-table_aet02.R
variant 12. - Changed the
scda
data version to '2022-02-28'. - Added a template to the
pkgdown
site. - Removed package dependencies of
grDevices
,stringr
, andviridisLite
. - Renaming
summarize_numeric_in_columns
tosummarize_variables_in_columns
. - Renaming
summarize_vars_numeric_in_cols
tosummarize_vars_in_cols
. - Fixed a bug where points on the
g_lineplot
plot were not connected in the case of missing values. - Updated the package authors.
v0.7.6
New features
- Added
h_map_for_count_abnormal
so that the map used intrim_levels_to_map
split function can be created by calling this helper function. Currently it supports two methods: one with all observed mapping, one with at least low limit above zero and at least one non missing high limit. - Added
s_summary_numeric_in_cols
andsummarize_vars_numeric_in_cols
functions to generate summary statistics in columns, mainly used for PK datasets. - Added five statistics to
s_summary.numeric
to use ins_summary_numeric_in_cols
.
Enhancements
- Enhanced functions
tabulate_survival_subgroups
andtabulate_rsp_subgroups
(Survival Duration and Best Overall Response analyses) to calculateN
-s based on the records considered to create the model. - Enhanced the function
estimate_proportion
and related functions to be able to apply a continuity correction in the Wilson method. - Refactored
count_abnormal_by_marked
and related statistics and formatting functions to use a more efficient layout with.spl_context
argument used for determining denominators and withtrim_levels_to_map
split function undersplit_rows_by
to show only the desired levels in the table. This is a breaking change. - Refactored
count_abnormal_by_worst_grade
and related statistics and formatting functions to use a more efficient layout with.spl_context
argument used for determining denominators and withtrim_levels_to_map
split function undersplit_rows_by
to show only the desired levels in the table. This is a breaking change. - Refactored
count_abnormal
function and related statistics and formatting functions to use a more efficient layout withtrim_levels_to_map
split function undersplit_rows_by
to show only the desired levels in the table. Also updatedabnormal
argument to be able to consider more than one level for each direction. This is a breaking change. - Enhanced the function
estimate_incidence_rate
and related functions to consider the week as time unit for data input.
Bug fixes
- Fixed bug in
assertthat
functions that output wrong data frame names and limited length of failure message outputs.
Miscellaneous
- Removed dependency on
utils.nest
by using thecheckmate
andpurrr
packages for validation and movedget_free_cores
andskip_if_too_deep
functions fromutils.nest
intotern
.
v0.7.5
New features
- Added functions to estimate continuous biomarker effects across multiple subgroups for survival and binary response endpoints, which can be used to produce corresponding forest plots, see
survival_biomarkers_subgroups
andresponse_biomarkers_subgroups
. - Added
g_lineplot
plot function, including newh_format_row
helper function andcontrol_lineplot_vars
function. Removedg_summary_by
. - Added new safety helper function
h_stack_by_baskets
to stack events in SMQ and/or CQ basket flag in ADAE data set.
Enhancements
- Added a couple of new statistics to
s_summary.numeric
. Addednames
attribute to each element of the final list returned by thes_summary.numeric
function. Addedsummary_formats
andsummary_labels
helper functions. - Added option to also convert logical variables to factor variables in
df_explicit_na
. - Refactored
h_append_grade_groups
to improve its flexibility, robustness and clearness as well as to make sure the result is ordered according to the order ofgrade_groups
. Also, addedremove_single
argument which controls whether the elements of one-element grade groups will be kept in the output or removed. - Added
var_labels
andshow_labels
arguments tocount_occurrences
andcount_patients_with_flags
to allow for creation of a title row. - Added
na_level
argument tocount_abnormal_by_baseline
.
Bug Fixes
- Fixed
prop_diff_cmh
to handle edge case of no FALSE (or TRUE) responses. - Enhanced
g_mmrm_diagnostic
to improve error handling when data is not amenable to the Locally Weighted Scatterplot Smoothing. - Several fixes in
g_km
:- Plot can now display any combination of the annotation tables for number of patients at risk, median survival time, and CoxPH summary.
- Function will return a warning instead of an error if the
arm
variable includes only one level andannot_coxph = TRUE
. - Lines in the plot now start correctly at time 0 and probability 1.
- The equals sign can now be used in category labels.
Miscellaneous
- Fixed
day2month
andmonth2day
to work with NA data. - Parametrized
stat_mean_ci
andstat_median_ci
so that they may return different outputs. - Added functionality in
h_row_counts
to handle analysis rows withNULL
cells. - Updated
LICENCE
andREADME
with new package references. - Added
error_on_lint: TRUE
to.lintr
.
v0.7.4
- Added new safety layout functions:
count_abnormal_by_marked
tabulates marked laboratory abnormalities.summarize_patients_exposure_in_cols
tabulates patient counts and sum of exposure across all patients.
- Enhanced
mmrm
related functions for fitting models withoutarm
variable. - Updated
cox_regression
to work without covariates. Also in case of interaction model summary, p-values for main effect coefficients are no longer displayed. - Descriptive statistics returned by
summarize_vars
now include quantiles. In addition,summarize_vars
now accepts the the control functioncontrol_summarize_vars
to specify details about confidence level for mean and median and quantile details. Thecontrol
argument replacesconf_level
. - Added
var_labels
andshow_labels
arguments tocount_occurrences_by_grade
. - Changed
indent
argument inappend_varlabels
to accept non-negative integer to represent the indent space defined by user. Previous calls with Booleanindent
will do an integer conversion and produce a warning. - Corrected
tabulate_survival_subgroups
and related survival forest plot functions to use total number of events, instead of observations, as default for scaling the symbol sizes in the plot. (The user might still use total number of observations manually if they wish to do so.) - Helper function
h_adsl_adlb_merge_using_worst_flag
will now correctly imputeBTOXGR
for missing visits. - Deleted
count_abnormal_by_worst_grade_by_baseline
and its related statistic and analysis functions as lab abnormality tables can be achieved using a simpler design. - Switched data in examples to use
scda
instead ofrandom.cdisc.data
package.
v0.7.3
- Added Subgroup Treatment Effect Pattern (STEP) model fitting functions
fit_rsp_step
andfit_survival_step
, the corresponding tidy methodtidy.step
as well as the graph functiong_step
. - Added new layout function
compare_vars
which compares variables of different types between columns and produces a p-value for the comparison to the reference column. It is built on top of thesummarize_vars
functionality. - Added utility functions:
cut_quantile_bins
cuts a numeric vector into quantile bins.fct_collapse_only
collapses levels of a factor and only keeps those in the order provided.fct_explicit_na_if
inserts explicit missings in a factor based on a condition.range_noinf
is a kind of a wrapper function ofbase::range
. It returnsc(NA, NA)
instead ofc(-Inf, Inf)
for zero-length data.
- Cox regression via
fit_coxreg_univar
andfit_coxreg_multivar
is now also possible without treatment arm. In the univariate case this means that separate univariate models for the provided covariates are fitted and the corresponding effect estimates can later be tabulated. - Added
fraction
in result returned bys_count_occurrences
. It contains a list of numerators and denominators with one element per occurrence. - Updated
sum_num_patients
andcount_occurrences
for the resultunique
andcount_fraction
to return (0, 0) when input is empty. - Added a new argument
groups_lists
toextract_survival_subgroups
,extract_rsp_subgroups
and associated helper functions which allows to group factor levels of subgroup variables into manually defined groups, enhancing the flexibility of the resulting forest graphs. - Forest graph function
g_forest
now extracts default arguments from attributes of the input table produced bytabulate_rsp_subgroups
andtabulate_survival_subgroups
so that the user does not have to do this manually anymore. - In
g_km
:- Remove arm variable name from arm labels in plot legend and annotation tables.
- Show symbol used to mark censored cases and match order of arm variable factor levels in the legend.
- Display hazard ratio and its confidence interval to two decimal places.
- Updated default position of hazard ratio table to stay on the left bottom corner but above x-axis.
- Use arm value as strata name in when treatment arm variable only has one level.
- Updated
s_surv_time
function to use a newly created functionrange_noinf
instead ofbase::range
. - New argument
no_fillin_visits
added toh_adsl_adlb_merge_using_worst_flag
to specify the visits that are excluded from post-baseline worst toxicity grade output. Improvedh_adsl_adlb_merge_using_worst_flag
to include variables shared betweenadsl
andadlb
, along withPARAM
,PARAMCD
,ATOXGR
,BTOXGR
and optionallyAVISIT
,AVISITN
whenby_visit = TRUE
. Previously, output only containsUSUBJID
,ARMCD
,PARAMCD
,ATOXGR
, andBTOXGR
. - Fix bug in
s_surv_timepoint
for cases when there are zero patients at risk. - Modified
stat_median_ci
function so that when empty var with empty name is passed, norow names contain missing values
error would show. - Deprecated
s_cox_univariate
function, usefit_coxreg_univar
function instead. - Updated default formats of hr and hr_ci in
a_coxph_pairwise
and median ins_surv_time
to align with STREAM. - Updated the pre-processing code in the files
test-table_ttet01.R
andtest-table_dort01.R
to make sure the analysis variableEVNT1
has both levels of the factor defined. - Improved error message when number of levels in a factor variable in a data frame is not as expected.