@@ -78,15 +78,113 @@ as_gt <- function(x, ...) {
78
78
# ' ) %>%
79
79
# ' summary() %>%
80
80
# ' as_gt()
81
- as_gt.fixed_design <- function (x , title = NULL , footnote = NULL , ... ) {
82
- method <- fd_method(x )
83
- ans <- gt :: gt(x ) %> %
84
- gt :: tab_header(title = title %|| % fd_title(method )) %> %
81
+ as_gt.design_fixed_summary <- function (x , title , footnote , ... ) {
82
+ gt :: gt(x ) %> %
83
+ gt :: tab_header(title = title ) %> %
85
84
gt :: tab_footnote(
86
- footnote = footnote % || % fd_footnote( x , method ) ,
85
+ footnote = footnote ,
87
86
locations = gt :: cells_title(group = " title" )
88
87
)
89
- return (ans )
88
+ }
89
+
90
+ # ' @rdname as_gt
91
+ # ' @export
92
+ as_gt.design_fixed_ahr_summary <- function (
93
+ x ,
94
+ title = " Fixed Design under AHR Method" ,
95
+ footnote = " Power computed with average hazard ratio method." ,
96
+ ...
97
+ ) {
98
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
99
+ }
100
+
101
+ # ' @rdname as_gt
102
+ # ' @export
103
+ as_gt.design_fixed_fh_summary <- function (
104
+ x ,
105
+ title = " Fixed Design under Fleming-Harrington Method" ,
106
+ footnote = paste(
107
+ " Power for Fleming-Harrington test" , substring(x $ Design , 19 ),
108
+ " using method of Yung and Liu."
109
+ ),
110
+ ...
111
+ ) {
112
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
113
+ }
114
+
115
+ # ' @rdname as_gt
116
+ # ' @export
117
+ as_gt.design_fixed_mb_summary <- function (
118
+ x ,
119
+ title = " Fixed Design under Magirr-Burman Method" ,
120
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
121
+ ...
122
+ ) {
123
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
124
+ }
125
+
126
+ # ' @rdname as_gt
127
+ # ' @export
128
+ as_gt.design_fixed_lf_summary <- function (
129
+ x ,
130
+ title = " Fixed Design under Lachin and Foulkes Method" ,
131
+ footnote = paste(
132
+ " Power using Lachin and Foulkes method applied using expected" ,
133
+ " average hazard ratio (AHR) at time of planned analysis."
134
+ ),
135
+ ...
136
+ ) {
137
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
138
+ }
139
+
140
+ # ' @rdname as_gt
141
+ # ' @export
142
+ as_gt.design_fixed_rd_summary <- function (
143
+ x ,
144
+ title = " Fixed Design of Risk Difference under Farrington-Manning Method" ,
145
+ footnote = paste(
146
+ " Risk difference power without continuity correction using method of" ,
147
+ " Farrington and Manning."
148
+ ),
149
+ ...
150
+ ) {
151
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
152
+ }
153
+
154
+ # ' @rdname as_gt
155
+ # ' @export
156
+ as_gt.design_fixed_maxcombo_summary <- function (
157
+ x ,
158
+ title = " Fixed Design under MaxCombo Method" ,
159
+ footnote = paste0(
160
+ " Power for MaxCombo test with Fleming-Harrington tests " ,
161
+ substring(x $ Design , 9 ), " ."
162
+ ),
163
+ ...
164
+ ) {
165
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
166
+ }
167
+
168
+ # ' @rdname as_gt
169
+ # ' @export
170
+ as_gt.design_fixed_milestone_summary <- function (
171
+ x ,
172
+ title = " Fixed Design under Milestone Method" ,
173
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
174
+ ...
175
+ ) {
176
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
177
+ }
178
+
179
+ # ' @rdname as_gt
180
+ # ' @export
181
+ as_gt.design_fixed_rmst_summary <- function (
182
+ x ,
183
+ title = " Fixed Design under Restricted Mean Survival Time Method" ,
184
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
185
+ ...
186
+ ) {
187
+ NextMethod(" as_gt" , x , title = title , footnote = footnote , ... )
90
188
}
91
189
92
190
get_method <- function (x , methods ) intersect(methods , class(x ))[1 ]
0 commit comments