Skip to content

Commit e766587

Browse files
Merge pull request #287 from jdblischak/as-gt
Redirect as_gt() to gsDesign2 when it is masked by simtrial::as_gt()
2 parents 5572317 + 733fb75 commit e766587

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method(as_gt,fixed_design)
4+
S3method(as_gt,gs_design)
35
S3method(as_gt,simtrial_gs_wlr)
46
S3method(summary,simtrial_gs_wlr)
57
S3method(wlr,counting_process)

R/as_gt.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,16 @@ as_gt.simtrial_gs_wlr <- function(x,
142142
gt::tab_header(title = title, subtitle = subtitle)
143143
}
144144
}
145+
146+
# Only purpose of the methods below is to fix S3 redirection when simtrial is
147+
# loaded after gsDesign2, which masks the as_gt() generic from gsDesign2
148+
149+
#' @export
150+
as_gt.fixed_design <- function(x, ...) {
151+
gsDesign2:::as_gt.fixed_design(x, ...)
152+
}
153+
154+
#' @export
155+
as_gt.gs_design <- function(x, ...) {
156+
gsDesign2:::as_gt.gs_design(x, ...)
157+
}

0 commit comments

Comments
 (0)