Skip to content

Commit

Permalink
Merge pull request #287 from jdblischak/as-gt
Browse files Browse the repository at this point in the history
Redirect as_gt() to gsDesign2 when it is masked by simtrial::as_gt()
  • Loading branch information
LittleBeannie authored Oct 9, 2024
2 parents 5572317 + 733fb75 commit e766587
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 e766587

Please sign in to comment.