From b25835fd378b49f40892450efe288e8ac5bfbaea Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:47:52 -0400 Subject: [PATCH 01/10] Bump up the version for release, and update authors. --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 905db15..257c988 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: metalite.ae Title: Adverse Events Analysis Using 'metalite' -Version: 0.1.1 +Version: 0.1.2 Authors@R: c( person("Yilong", "Zhang", role = c("aut")), person("Yujie", "Zhao", email = "yujie.zhao@merck.com", role = c("aut", "cre")), @@ -12,6 +12,8 @@ Authors@R: c( person("Ruchitbhai", "Patel", role = c("aut")), person("Brian", "Lang", role = c("aut")), person("Xuan", "Deng", role = c("aut")), + person("Hiroaki", "Fukuda", role = c("aut")), + person("Bing", "Liu", role = c("aut")), person("Merck Sharp & Dohme Corp", role = c("cph")) ) Description: Analyzes adverse events in clinical trials using the 'metalite' From b8d3c1e66227e0e4761e43df5ed584eff6e4b72a Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:48:35 -0400 Subject: [PATCH 02/10] Add updates for CRAN v0.1.2 release. --- NEWS.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5f93193..9faf25f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,32 @@ # metalite.ae 0.1.2 -- Updated `format_ae_specific` to avoid warning when no comparison variables are -requested. +## New features +- `tlf_ae_summary()` and `tlf_ae_specific` now have a new argument `title` for a user-customized title. +- Add new functions: `rate_compare_sum()`, `extend_ae_specific_subgroup()`, `prepare_ae_specific_subgroup()`, `format_ae_specific_subgroup()`, `tlf_ae_specific_subgroup()`, `extend_ae_summary_eaer()`, +`format_ae_exp_adj()` and `tlf_ae_exp_adj()`. +- Add `data/metalite_ae_adex.Rda`. +- Add new vignettes: 'Subgroup Analysis for Specific AE' and 'Exposure Adjusted Event Rate'. +- Add test cases for new functions. + +## Bug fixes +- Fix bug to avoid warning messages when no comparison variables are requested in `format_ae_specific()`. +- Fix bug to align the row rder of output data with the input one in `avg_event()` and `avg_duration()`. +- Fix bug to display item if AE term has `NA` in `prepare_ae_specific()`. +- Fix bug to correctly assign treatment labels when a treatment variable has `NA`. + +## Improvements +- Update Github Actions workflow. +- Add styler workflow. +- Add CRAN download badge. +- Remove dependencies on `dplyr` and `tidyr` from `avg_event()`, `avg_duration()` and `fmt_val()`. +- Remove `R/n_subject.R` and change to use `metalite::n_subject()` in `prepare_ae_specific()`. +- Race values for adsl and adae are converted to title case in `meta_ae_exmple()`. +- Rename `R/rtf_output.R` to `R/utility.R`. +- Remove `R/to_mock.R` and `R/to_sentence.R`, and `to_mock()` and `to_sentence()` are moved to `R/utility.R`. +- Remove library calls from tests. +- Add `R/outdata.R` to control `outdata` object. +- Add an installation section to `README.Rd`. +- Improve style and formatting for vignettes and codes. # metalite.ae 0.1.1 From 6d50ce6db8bb09771b9b945259fcb7f85f2b09f3 Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:49:28 -0400 Subject: [PATCH 03/10] Add authors. --- man/metalite.ae-package.Rd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/metalite.ae-package.Rd b/man/metalite.ae-package.Rd index fd06e0e..a45af5e 100644 --- a/man/metalite.ae-package.Rd +++ b/man/metalite.ae-package.Rd @@ -32,6 +32,8 @@ Authors: \item Ruchitbhai Patel \item Brian Lang \item Xuan Deng + \item Hiroaki Fukuda + \item Bing Liu } Other contributors: From 8e4954613637ec39f2fe487d5ff4f493e1804478 Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:50:11 -0400 Subject: [PATCH 04/10] Update the copy right year. --- _pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index a1d0d46..62a6467 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -20,7 +20,7 @@ footer: left: [developed_by, built_with, legal] right: [blank] components: - legal: "
Copyright © 2023 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved." + legal: "
Copyright © 2024 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved." blank: "" navbar: From 81a023617cbf27c017925f261f655091cad4938c Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:52:33 -0400 Subject: [PATCH 05/10] Remove unnecessary parameter definitions. --- R/extend_ae_specific.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/extend_ae_specific.R b/R/extend_ae_specific.R index 5940111..e7d2e63 100644 --- a/R/extend_ae_specific.R +++ b/R/extend_ae_specific.R @@ -343,8 +343,6 @@ extend_ae_specific_events <- function(outdata) { #' #' @param outdata An `outdata` object created by [prepare_ae_specific()]. #' @param subgroup_var a character string for subgroup variable name -#' @param outdata An `outdata` object created by [prepare_ae_specific()]. -#' @param subgroup A character string for subgroup variable name. #' #' @return A list of analysis raw datasets. #' @export From ca0659618ef64e6ce5ceac7a1b52b2bf516ef898 Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:52:56 -0400 Subject: [PATCH 06/10] Style documentation. --- man/extend_ae_specific_subgroup.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/extend_ae_specific_subgroup.Rd b/man/extend_ae_specific_subgroup.Rd index 0789ee8..344b646 100644 --- a/man/extend_ae_specific_subgroup.Rd +++ b/man/extend_ae_specific_subgroup.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/extend_ae_specific.R \name{extend_ae_specific_subgroup} \alias{extend_ae_specific_subgroup} -\title{Add Subgroup analysis in AE specific analysis} +\title{Add subgroup analysis in AE specific analysis} \usage{ extend_ae_specific_subgroup(outdata, subgroup_var) } @@ -15,7 +15,7 @@ extend_ae_specific_subgroup(outdata, subgroup_var) A list of analysis raw datasets. } \description{ -Add Subgroup analysis in AE specific analysis +Add subgroup analysis in AE specific analysis } \examples{ meta <- meta_ae_example() @@ -24,5 +24,5 @@ tbl <- prepare_ae_specific(meta, observation = "wk12", parameter = "rel" ) |> - extend_ae_specific_subgroup(subgroup_var= "SEX") + extend_ae_specific_subgroup(subgroup_var = "SEX") } From 91d35d2462feced8e48eedebf42ff2b2d3b0890a Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Wed, 13 Mar 2024 02:56:03 -0400 Subject: [PATCH 07/10] Set `message = FALSE` to avoid displaying an individual parameter for checking in the result. --- vignettes/exposure-adjusted-event-rate.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/exposure-adjusted-event-rate.Rmd b/vignettes/exposure-adjusted-event-rate.Rmd index 277f7aa..d0b2714 100644 --- a/vignettes/exposure-adjusted-event-rate.Rmd +++ b/vignettes/exposure-adjusted-event-rate.Rmd @@ -97,7 +97,7 @@ $$ library(metalite.ae) ``` -```{r} +```{r, message = FALSE} meta <- meta_ae_example() x <- meta |> From 8232235cf9cff6438b02265f4ad5b1f7f706935d Mon Sep 17 00:00:00 2001 From: "Wang, Benjamin" Date: Thu, 28 Mar 2024 13:54:55 -0400 Subject: [PATCH 08/10] update news and prepare_ae_specific --- NEWS.md | 3 ++- R/prepare_ae_specific.R | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9faf25f..61d6f6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,10 +7,11 @@ - Add `data/metalite_ae_adex.Rda`. - Add new vignettes: 'Subgroup Analysis for Specific AE' and 'Exposure Adjusted Event Rate'. - Add test cases for new functions. +- Add system organ class(SOC) information to `outdata` in `prepare_ae_specific()` ## Bug fixes - Fix bug to avoid warning messages when no comparison variables are requested in `format_ae_specific()`. -- Fix bug to align the row rder of output data with the input one in `avg_event()` and `avg_duration()`. +- Fix bug to align the row order of output data with the input one in `avg_event()` and `avg_duration()`. - Fix bug to display item if AE term has `NA` in `prepare_ae_specific()`. - Fix bug to correctly assign treatment labels when a treatment variable has `NA`. diff --git a/R/prepare_ae_specific.R b/R/prepare_ae_specific.R index eb70721..fc8fae5 100644 --- a/R/prepare_ae_specific.R +++ b/R/prepare_ae_specific.R @@ -156,6 +156,7 @@ prepare_ae_specific <- function(meta, soc_n[[par_var]] <- soc_n$name soc_n$order <- 1e3 * seq_len(nrow(soc_n)) soc_n$name <- to_sentence(soc_n$name) + soc_n$soc_name <- soc_n$name } else { soc_n <- NULL } @@ -173,6 +174,7 @@ prepare_ae_specific <- function(meta, par_n$order <- 1e3 * as.numeric(factor(par_n[[par_soc]])) + seq_len(nrow(par_n)) par_n$order[is.na(par_n$order)] <- (if (!all(is.na(soc_n$order))) max(soc_n$order, na.rm = TRUE) else -Inf) + 1 par_n$name <- to_sentence(par_n$name) + par_n$soc_name <- par_n[[par_soc]] } else { par_n <- NULL } @@ -183,8 +185,14 @@ prepare_ae_specific <- function(meta, names(blank_row) <- names(pop_n[, col]) # Combine count values - tbl <- rbind(pop_n[, col], obs_n[, col], blank_row, par_n[, col], soc_n[, col]) + tbl0 <- rbind(pop_n[, col], obs_n[, col], blank_row) + tbl0$soc_name <- NA + tbl <- rbind(par_n[, c(col, "soc_name")], soc_n[, c(col, "soc_name")]) + tbl <- rbind(tbl0, tbl) tbl <- tbl[order(tbl$order), ] + soc_name <- tbl$soc_name + tbl <- tbl[,!(names(tbl) %in% "soc_name")] + # Calculate Proportion tbl_num <- tbl[, u_group] @@ -205,6 +213,7 @@ prepare_ae_specific <- function(meta, prop = tbl_rate, diff = tbl_diff, n_pop = tbl_num[1, ], name = tbl$name, + soc_name =soc_name, components = components, prepare_call = match.call() ) From 386666196cdcdf5697527b49252e98e02a0a6955 Mon Sep 17 00:00:00 2001 From: wangben718 Date: Thu, 28 Mar 2024 17:58:24 +0000 Subject: [PATCH 09/10] Style code (GHA) --- R/prepare_ae_specific.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/prepare_ae_specific.R b/R/prepare_ae_specific.R index fc8fae5..60d36a4 100644 --- a/R/prepare_ae_specific.R +++ b/R/prepare_ae_specific.R @@ -191,7 +191,7 @@ prepare_ae_specific <- function(meta, tbl <- rbind(tbl0, tbl) tbl <- tbl[order(tbl$order), ] soc_name <- tbl$soc_name - tbl <- tbl[,!(names(tbl) %in% "soc_name")] + tbl <- tbl[, !(names(tbl) %in% "soc_name")] # Calculate Proportion @@ -213,7 +213,7 @@ prepare_ae_specific <- function(meta, prop = tbl_rate, diff = tbl_diff, n_pop = tbl_num[1, ], name = tbl$name, - soc_name =soc_name, + soc_name = soc_name, components = components, prepare_call = match.call() ) From e5017522852b3ef327d2ab30558d16815ea7b062 Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Sun, 7 Apr 2024 20:39:04 -0400 Subject: [PATCH 10/10] Update `NEWS.md` to add information, and to improve formatting and wording. --- NEWS.md | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/NEWS.md b/NEWS.md index 61d6f6f..adf1230 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,33 +1,39 @@ # metalite.ae 0.1.2 ## New features -- `tlf_ae_summary()` and `tlf_ae_specific` now have a new argument `title` for a user-customized title. -- Add new functions: `rate_compare_sum()`, `extend_ae_specific_subgroup()`, `prepare_ae_specific_subgroup()`, `format_ae_specific_subgroup()`, `tlf_ae_specific_subgroup()`, `extend_ae_summary_eaer()`, -`format_ae_exp_adj()` and `tlf_ae_exp_adj()`. -- Add `data/metalite_ae_adex.Rda`. -- Add new vignettes: 'Subgroup Analysis for Specific AE' and 'Exposure Adjusted Event Rate'. -- Add test cases for new functions. -- Add system organ class(SOC) information to `outdata` in `prepare_ae_specific()` + +- `tlf_ae_summary()` now has a new argument `title` for a user-customized title (#133). +- Add new functions: `extend_ae_specific_subgroup()`, `prepare_ae_specific_subgroup()`, `format_ae_specific_subgroup()`, `tlf_ae_specific_subgroup()`, `extend_ae_summary_eaer()`, +`format_ae_exp_adj()` and `tlf_ae_exp_adj()` (#150, #161, #174, #180). +- Add `data/metalite_ae_adex.rda` (#164). +- Add new vignettes: `vignette("ae-specific-subgroup")` and `vignette("exposure-adjusted-event-rate")` (#167, #169). +- Add System Organ Classes (SOC) information to `outdata` in `prepare_ae_specific()` (#186). ## Bug fixes -- Fix bug to avoid warning messages when no comparison variables are requested in `format_ae_specific()`. -- Fix bug to align the row order of output data with the input one in `avg_event()` and `avg_duration()`. -- Fix bug to display item if AE term has `NA` in `prepare_ae_specific()`. -- Fix bug to correctly assign treatment labels when a treatment variable has `NA`. + +- Fix bug to avoid warning messages when no comparison variables are requested in `format_ae_specific()` (#135). +- Fix bug to align the row order of output data with the input one in `avg_event()` and `avg_duration()` (#136). +- Fix bug to check missing grouping variable after a subset of input data in `prepare_ae_specific()` (#137). +- Fix bug to display item if AE term has `NA` in `prepare_ae_specific()` (#166). +- Fix bug to correctly assign treatment labels when a treatment variable has `NA` (#179). ## Improvements -- Update Github Actions workflow. -- Add styler workflow. -- Add CRAN download badge. -- Remove dependencies on `dplyr` and `tidyr` from `avg_event()`, `avg_duration()` and `fmt_val()`. -- Remove `R/n_subject.R` and change to use `metalite::n_subject()` in `prepare_ae_specific()`. -- Race values for adsl and adae are converted to title case in `meta_ae_exmple()`. -- Rename `R/rtf_output.R` to `R/utility.R`. -- Remove `R/to_mock.R` and `R/to_sentence.R`, and `to_mock()` and `to_sentence()` are moved to `R/utility.R`. -- Remove library calls from tests. -- Add `R/outdata.R` to control `outdata` object. -- Add an installation section to `README.Rd`. -- Improve style and formatting for vignettes and codes. + +- Update GitHub Actions workflow (#131, #163, #181). +- Add styler workflow (#134). +- Add CRAN download badge (#140). +- Remove dependencies on `dplyr` and `tidyr` from `avg_event()`, `avg_duration()` and `fmt_val()` (#136). +- Change the default value of the `title` argument in `tlf_ae_specific()` (#138). +- Remove `R/n_subject.R` and change to use `metalite::n_subject()` in `prepare_ae_specific()` (#144). +- Race values for adsl and adae are converted to title case in `meta_ae_exmple()` (#158). +- Organize files for utility functions (#159) + - Rename `R/rtf_output.R` to `R/utility.R`. + - Remove `rate_compare_sum.R`, `R/to_mock.R` and `R/to_sentence.R`. + - Move `to_rate_compare_sum()` to `R/rate_compare.R`, and move `to_mock()` and `to_sentence()` to `R/utility.R`. +- Remove library calls from tests (#183). +- Add `R/outdata.R` to control `outdata` object (#161). +- Add an installation section to `README.md` (#177). +- Improve style and formatting for vignettes and code (#158, #168). # metalite.ae 0.1.1