From 440bca773dcb4f8556a74fc3cf9bbd5539a035d0 Mon Sep 17 00:00:00 2001 From: John Blischak Date: Thu, 26 Sep 2024 15:41:15 -0400 Subject: [PATCH] Redirect as_gt() to simtrial when it is masked by gsDesign2::as_gt() --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/as_gt.R | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index eb3e7194..7cba31c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: gsDesign2 Title: Group Sequential Design with Non-Constant Effect -Version: 1.1.2.22 +Version: 1.1.2.23 Authors@R: c( person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")), person("Yilong", "Zhang", email = "elong0527@gmail.com", role = c("aut")), diff --git a/NAMESPACE b/NAMESPACE index a37b0f94..4839c16c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ S3method(as_gt,fixed_design) S3method(as_gt,gs_design) +S3method(as_gt,simtrial_gs_wlr) S3method(as_rtf,fixed_design) S3method(as_rtf,gs_design) S3method(summary,fixed_design) diff --git a/R/as_gt.R b/R/as_gt.R index 53849692..065009bd 100644 --- a/R/as_gt.R +++ b/R/as_gt.R @@ -415,3 +415,11 @@ gsd_parts <- function( alpha = max(filter(x, Bound == bound[1])[[alpha_column]]) ) } + +# Only purpose of the method below is to fix S3 redirection when gsDesign2 is +# loaded after simtrial, which masks the as_gt() generic from simtrial + +#' @export +as_gt.simtrial_gs_wlr <- function(x, ...) { + simtrial:::as_gt.simtrial_gs_wlr(x, ...) +}