From ae1a3861637ea203e7b800555ecfb6988934a8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Mon, 23 Oct 2023 03:59:19 +0200 Subject: [PATCH] Adds min package version (#1012) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WIP :: parent issue: https://github.com/insightsengineering/nestdevs-tasks/issues/7 Supersede: * https://github.com/insightsengineering/tern/pull/957 ### 🔴 Checklist for PR Reviewer [![Scheduled 🕰️](https://github.com/insightsengineering/tern/actions/workflows/scheduled.yaml/badge.svg?branch=verdepcheck_action)](https://github.com/insightsengineering/tern/actions/workflows/scheduled.yaml) _(~~max strategy fails due to https://github.com/tidyverse/ggplot2/issues/5436~~ corrected upstream)_ - [ ] Tag yourself next to this repo on https://github.com/insightsengineering/nestdevs-tasks/issues/7 - [ ] Package versions are the same or higher than `main` - [ ] Package list is the same - Only exception is `rmarkdown` (may have been removed on `Suggests`) - [ ] All packages in `Imports`, `Depends` & `Suggests` are in new section `Config/Needs/verdepcheck` - [ ] Added entry to `NEWS.md` - [ ] Last `scheduled.yaml` action was run succesfully _(all 4 strategies)_ - important: it's not the last commit, it's the one that runs 4 `Scheduled 🕰️ / Dependency` actions - [ ] `scheduled.yaml` SHOULD NOT have any push on any branches ### 🔴 What's needed before merging? This PR depends on some upstream changes that need to be finalized/merged before being ready to review. #### Change in code * `verdepcheck.yml` action (see comments) - [x] Remove `on: push` section - [x] Change branch to main #### PRS - [x] verdepcheck * https://github.com/insightsengineering/verdepcheck/pull/24 * https://github.com/insightsengineering/verdepcheck/pull/26 - [x] verdepcheck-action * https://github.com/insightsengineering/r-verdepcheck-action/pull/16 ### Changes description * Adds minimum version for packages `DESCRIPTION` * Adds `Config/Need/verdepcheck` section in `DESCRIPTION` * Updates verdepcheck action --------- Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com> Co-authored-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> --- .github/workflows/scheduled.yaml | 2 +- DESCRIPTION | 71 ++++++++++++++++++++++---------- NEWS.md | 63 ++++++++++++++-------------- 3 files changed, 83 insertions(+), 53 deletions(-) diff --git a/.github/workflows/scheduled.yaml b/.github/workflows/scheduled.yaml index 62afcda85a..df66705fe6 100644 --- a/.github/workflows/scheduled.yaml +++ b/.github/workflows/scheduled.yaml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - test-strategy: ["min", "release", "max"] + test-strategy: ["min_cohort", "min_isolated", "release", "max"] uses: insightsengineering/r.pkg.template/.github/workflows/verdepcheck.yaml@main name: Dependency Test - ${{ matrix.test-strategy }} 🔢 secrets: diff --git a/DESCRIPTION b/DESCRIPTION index 9af9f0e991..0924da27ff 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,44 +23,71 @@ Depends: R (>= 3.6), rtables (>= 0.6.5) Imports: - broom, - car, - checkmate, - cowplot, - dplyr, - emmeans (>= 1.4.5), + broom (>= 0.5.4), + car (>= 3.0-13), + checkmate (>= 2.1.0), + cowplot (>= 0.7.0), + dplyr (>= 1.0.0), + emmeans (>= 1.8.0), forcats (>= 1.0.0), formatters (>= 0.5.4), ggplot2 (>= 3.4.0), grid, - gridExtra, - gtable, + gridExtra (>= 2.0.0), + gtable (>= 0.3.0), labeling, - lifecycle, - magrittr, + lifecycle (>= 0.2.0), + magrittr (>= 1.5), methods, - Rdpack, - rlang, - scales, + Rdpack (>= 2.4), + rlang (>= 1.1.0), + scales (>= 1.2.0), stats, survival (>= 3.2-13), - tibble, - tidyr, + tibble (>= 2.0.0), + tidyr (>= 0.8.3), utils Suggests: - knitr, - lattice, - lubridate, + knitr (>= 1.42), + lattice (>= 0.18-4), + lubridate (>= 1.7.9), nestcolor (>= 0.1.1), - rmarkdown, - stringr, - testthat (>= 3.0), - vdiffr (>= 1.0.0) + rmarkdown (>= 2.19), + stringr (>= 1.4.1), + testthat (>= 3.1.9), + vdiffr (>= 1.0.7) VignetteBuilder: knitr RdMacros: lifecycle, Rdpack +Config/Needs/verdepcheck: + insightsengineering/rtables, + tidymodels/broom, + cran/car, + mllg/checkmate, + wilkelab/cowplot, + tidyverse/dplyr, + rvlenth/emmeans, + tidyverse/forcats, + insightsengineering/formatters, + tidyverse/ggplot2, + r-lib/gtable, + r-lib/lifecycle, + tidyverse/magrittr, + GeoBosh/Rdpack, + r-lib/rlang, + r-lib/scales, + tidyverse/tibble, + tidyverse/tidyr, + yihui/knitr, + deepayan/lattice, + tidyverse/lubridate, + insightsengineering/nestcolor, + rstudio/rmarkdown, + tidyverse/stringr, + r-lib/testthat, + r-lib/vdiffr Config/Needs/website: insightsengineering/nesttemplate Config/testthat/edition: 3 Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index 2a6d0f2443..192e14cb29 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # tern 0.9.2.9000 +### Miscellaneous +* Specified minimal version of package dependencies. + # tern 0.9.2 ### New Features @@ -65,7 +68,7 @@ ### 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`. +* Added `flag_labels` argument to `s_count_patients_with_flags` to enable more label handling options in `count_patients_by_flags`. * Added the `nested` argument to `analyze` 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`, `count_patients_with_event`, `count_patients_with_flags`, `count_values`, `estimate_multinomial_response`, `estimate_proportion`, `estimate_incidence_rate`, `estimate_odds_ratio`, `estimate_proportion_diff`, `test_proportion_diff`, `summarize_ancova`, `summarize_change`, `summarize_glm_count`, `analyze_num_patients`, `coxph_pairwise`, `surv_time`, and `surv_timepoint`. ## Miscellaneous @@ -139,7 +142,7 @@ ### 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 +* Added formatting functions `format_fraction_fixed_dp` and `format_count_fraction_fixed_dp` with fixed single decimal place in percentages. * Added `na_level` and `labelstr` arguments to `summarize_vars_in_cols`. * Added `analyze_num_patients` to include summary at the beginning that does not @@ -147,11 +150,11 @@ * 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 from `unique_count` labels for `s_num_patients`. -* Added options to `g_km` to annotate with statistics (`annot_stats`) and add corresponding +* 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 +* Fixed bug causing incorrect ordering of numeric grade levels when missing grades are present in `s_count_occurrences_by_grade`. * Refactored `summarize_vars_in_cols` to work with pagination machinery. * Fixed bug to allow passing of `conf_level` argument to `emmeans::contrast()` in `s_ancova`. @@ -166,11 +169,11 @@ * 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 +* 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 use `iris` dataset instead of `scda` data. -* Created vignette which saves cached synthetic `CDISC` dataset files to the `data/` folder and +* 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 of `scda` datasets. * Removed all template tests from `tern`. These tests are in internal repo `scda.test`. @@ -189,40 +192,40 @@ ### 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 +* Added `stat_mean_pval`, a new summary statistic to calculate the p-value of the mean. -* Added statistic `mean_se` (mean with standard error) for `summarize_variables` +* Added statistic `mean_se` (mean with standard error) for `summarize_variables` and related functions. * Introduced again `Rdpack` for references. -### Enhancements -* Redesign of data handling in tests by removing repetitive data loads and +### Enhancements +* Redesign of data handling in tests by removing repetitive data loads and library calls. * Added `DescTools::BinomDiffCI` function within `tern`. -* Added new parameter to `summarize_logistic` to specify which pivoted value +* 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 +* 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 adapting `g_km`, `g_ipp`, +* Implemented `nestcolor` in all examples by adapting `g_km`, `g_ipp`, `g_waterfall`, `g_step`, `g_lineplot`, and `g_forest`. -* Added parameters `interaction_y` and `interaction_item` in `ANCOVA` to make the +* Added parameters `interaction_y` and `interaction_item` in `ANCOVA` to make the interaction calculations available. * Added new parameter `footnotes` to add footnotes to `g_km`. ### Migration from `assertthat` to `checkmate` -* Implemented `checkmate::assert_vector`, `checkmate::assert_set_equal`, and +* 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`, + `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` and `has_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`, +* 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` and `assert_proportion_value` internal functions. -* Renamed `assertthat.R` and `test-assertthat.R` to `utils_checkmate.R` and +* Renamed `assertthat.R` and `test-assertthat.R` to `utils_checkmate.R` and `test-utils_checkmate.R`. ### Documentation and NAMESPACE Polishing @@ -252,7 +255,7 @@ `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), + `format_fraction`, `combination_function` (S4 method), `compare_variables` (S3 method), `kaplan_meier`. * Internal keywords added, export removed, `_pkgdown.yml` updated, and `tern:::` added for tests/examples/vignettes where present for the following functions: @@ -287,24 +290,24 @@ * 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_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 one `PARAM` 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 added `dontrun` +* Removed internal function calls in examples (`tern:::`) and added `dontrun` to internal function examples. * Removed warnings and messages to console occurring in examples and tests. -* Deprecated functions `color_palette` and `h_set_nest_theme` in favor of +* Deprecated functions `color_palette` and `h_set_nest_theme` in favor of `nestcolor::color_palette` and `nestcolor::theme_nest`, respectively. -* Removed deprecated functions: `color_palette`, `color_palette_core`, +* 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`, +* 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` to `study_arm` and `extract` to `extract_by_name`. * Renamed `rtables.R` to `utils_rtables.R`.