Skip to content

Commit

Permalink
Merge pull request #83 from AstraZeneca/hce_update_fix
Browse files Browse the repository at this point in the history
Hce update fix
  • Loading branch information
Monika-H authored Oct 4, 2023
2 parents 5278cfc + a127536 commit 08ab1e8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: maraca
Version: 0.5.0
Version: 0.5.1
Type: Package
Title: The Maraca Plot: Visualization of Hierarchical Composite Endpoints in Clinical Trials
License: Apache License (>= 2)
Expand All @@ -12,7 +12,8 @@ Description: Library that supports visual interpretation of hierarchical composi
endpoints (HCEs). HCEs are complex constructs used as primary endpoints in
clinical trials, combining outcomes of different types into ordinal endpoints,
in which each patient contributes the most clinically important event (one and
only one) to the analysis.
only one) to the analysis. See Karpefors M et al. (2022)
<doi:10.1177/17407745221134949>.
URL: https://github.com/AstraZeneca/maraca
BugReports: https://github.com/AstraZeneca/maraca/issues
Encoding: UTF-8
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# maraca 0.5.1

## Bug fixes

- Small bug fix to account for changes in HCE objects created in newest
version of HCE package

# maraca 0.5.0

## New features
Expand Down
1 change: 1 addition & 0 deletions R/general.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' @docType package
#' @name maraca
#' @aliases maraca-package
NULL

#' Example HCE scenario A.
Expand Down
6 changes: 6 additions & 0 deletions R/maraca.R
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ plot.hce <- function(x, continuous_outcome = "C",
x <- as.data.frame(x)
TTE <- sort(unique(x$GROUP)[unique(x$GROUP) != continuous_outcome])

# Small bugfix to allow for name change of variable TTEFixed in newer
# version of HCE package
if ("PADY" %in% names(x)) {
x$TTEfixed <- x$PADY
}

if (is.null(fixed_followup_days)) {
checkmate::assertNames(names(x), must.include = "TTEfixed")
checkmate::assert_int(x$TTEfixed[[1]])
Expand Down
1 change: 1 addition & 0 deletions man/maraca.Rd

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

11 changes: 11 additions & 0 deletions tests/testthat/test_maraca.R
Original file line number Diff line number Diff line change
Expand Up @@ -1018,4 +1018,15 @@ test_that("plotHCE", {
set_pdf_output(output)
plot(HCE, fixed_followup_days = 6 * 365)
expect_file_exists(output)

if (!("PADY" %in% names(HCE))) {
HCE$PADY <- HCE$TTEfixed
}
HCE$TTEfixed <- NULL
output <- artifacts_path("plotHCE-newVersionHCEpkg.pdf")
expect_file_not_exists(output)
set_pdf_output(output)
plot(HCE)
expect_file_exists(output)

})

0 comments on commit 08ab1e8

Please sign in to comment.