Skip to content

Commit

Permalink
Redirect as_gt() to gsDesign2 when it is masked by simtrial::as_gt()
Browse files Browse the repository at this point in the history
  • Loading branch information
jdblischak committed Oct 4, 2024
1 parent 5572317 commit 733fb75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(as_gt,fixed_design)
S3method(as_gt,gs_design)
S3method(as_gt,simtrial_gs_wlr)
S3method(summary,simtrial_gs_wlr)
S3method(wlr,counting_process)
Expand Down
13 changes: 13 additions & 0 deletions R/as_gt.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,16 @@ as_gt.simtrial_gs_wlr <- function(x,
gt::tab_header(title = title, subtitle = subtitle)
}
}

# Only purpose of the methods below is to fix S3 redirection when simtrial is
# loaded after gsDesign2, which masks the as_gt() generic from gsDesign2

#' @export
as_gt.fixed_design <- function(x, ...) {
gsDesign2:::as_gt.fixed_design(x, ...)
}

#' @export
as_gt.gs_design <- function(x, ...) {
gsDesign2:::as_gt.gs_design(x, ...)
}

0 comments on commit 733fb75

Please sign in to comment.