Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parepare cran release #186

Merged
merged 10 commits into from
Apr 8, 2024
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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")),
Expand All @@ -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'
Expand Down
36 changes: 34 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
# metalite.ae 0.1.2

- Updated `format_ae_specific` to avoid warning when no comparison variables are
requested.
## New features

- `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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a blank line between headings and content.


- 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 (#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

Expand Down
2 changes: 0 additions & 2 deletions R/extend_ae_specific.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion R/prepare_ae_specific.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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]
Expand All @@ -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()
)
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ footer:
left: [developed_by, built_with, legal]
right: [blank]
components:
legal: "<br>Copyright &copy; 2023 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved."
legal: "<br>Copyright &copy; 2024 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved."
blank: "<span></span>"

navbar:
Expand Down
6 changes: 3 additions & 3 deletions man/extend_ae_specific_subgroup.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/metalite.ae-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/exposure-adjusted-event-rate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $$
library(metalite.ae)
```

```{r}
```{r, message = FALSE}
meta <- meta_ae_example()

x <- meta |>
Expand Down