@@ -91,19 +91,18 @@ as_rtf <- function(x, ...) {
91
91
# ' ) %>%
92
92
# ' summary() %>%
93
93
# ' as_rtf(file = tempfile(fileext = ".rtf"))
94
- as_rtf.fixed_design <- function (
94
+ as_rtf.design_fixed_summary <- function (
95
95
x ,
96
- title = NULL ,
97
- footnote = NULL ,
96
+ title ,
97
+ footnote ,
98
98
col_rel_width = NULL ,
99
99
orientation = c(" portrait" , " landscape" ),
100
100
text_font_size = 9 ,
101
101
file ,
102
102
... ) {
103
103
orientation <- match.arg(orientation )
104
- method <- fd_method(x )
105
- title <- title %|| % paste(fd_title(method ), " {^a}" )
106
- footnote <- footnote %|| % paste(" {^a}" , fd_footnote(x , method ))
104
+ title <- paste(title , " {^a}" )
105
+ footnote <- paste(" {^a}" , footnote )
107
106
108
107
# set default column width
109
108
n_row <- nrow(x )
@@ -146,6 +145,154 @@ as_rtf.fixed_design <- function(
146
145
invisible (x )
147
146
}
148
147
148
+ # ' @rdname as_rtf
149
+ # ' @export
150
+ as_rtf.design_fixed_ahr_summary <- function (
151
+ x ,
152
+ title = " Fixed Design under AHR Method" ,
153
+ footnote = " Power computed with average hazard ratio method." ,
154
+ col_rel_width = NULL ,
155
+ orientation = c(" portrait" , " landscape" ),
156
+ text_font_size = 9 ,
157
+ file ,
158
+ ...
159
+ ) {
160
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
161
+ col_rel_width = col_rel_width , orientation = orientation ,
162
+ text_font_size = text_font_size , file = file , ... )
163
+ }
164
+
165
+ # ' @rdname as_rtf
166
+ # ' @export
167
+ as_rtf.design_fixed_fh_summary <- function (
168
+ x ,
169
+ title = " Fixed Design under Fleming-Harrington Method" ,
170
+ footnote = paste(
171
+ " Power for Fleming-Harrington test" , substring(x $ Design , 19 ),
172
+ " using method of Yung and Liu."
173
+ ),
174
+ col_rel_width = NULL ,
175
+ orientation = c(" portrait" , " landscape" ),
176
+ text_font_size = 9 ,
177
+ file ,
178
+ ...
179
+ ) {
180
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
181
+ col_rel_width = col_rel_width , orientation = orientation ,
182
+ text_font_size = text_font_size , file = file , ... )
183
+ }
184
+
185
+ # ' @rdname as_rtf
186
+ # ' @export
187
+ as_rtf.design_fixed_mb_summary <- function (
188
+ x ,
189
+ title = " Fixed Design under Magirr-Burman Method" ,
190
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
191
+ col_rel_width = NULL ,
192
+ orientation = c(" portrait" , " landscape" ),
193
+ text_font_size = 9 ,
194
+ file ,
195
+ ...
196
+ ) {
197
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
198
+ col_rel_width = col_rel_width , orientation = orientation ,
199
+ text_font_size = text_font_size , file = file , ... )
200
+ }
201
+
202
+ # ' @rdname as_rtf
203
+ # ' @export
204
+ as_rtf.design_fixed_lf_summary <- function (
205
+ x ,
206
+ title = " Fixed Design under Lachin and Foulkes Method" ,
207
+ footnote = paste(
208
+ " Power using Lachin and Foulkes method applied using expected" ,
209
+ " average hazard ratio (AHR) at time of planned analysis."
210
+ ),
211
+ col_rel_width = NULL ,
212
+ orientation = c(" portrait" , " landscape" ),
213
+ text_font_size = 9 ,
214
+ file ,
215
+ ...
216
+ ) {
217
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
218
+ col_rel_width = col_rel_width , orientation = orientation ,
219
+ text_font_size = text_font_size , file = file , ... )
220
+ }
221
+
222
+ # ' @rdname as_rtf
223
+ # ' @export
224
+ as_rtf.design_fixed_rd_summary <- function (
225
+ x ,
226
+ title = " Fixed Design of Risk Difference under Farrington-Manning Method" ,
227
+ footnote = paste(
228
+ " Risk difference power without continuity correction using method of" ,
229
+ " Farrington and Manning."
230
+ ),
231
+ col_rel_width = NULL ,
232
+ orientation = c(" portrait" , " landscape" ),
233
+ text_font_size = 9 ,
234
+ file ,
235
+ ...
236
+ ) {
237
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
238
+ col_rel_width = col_rel_width , orientation = orientation ,
239
+ text_font_size = text_font_size , file = file , ... )
240
+ }
241
+
242
+ # ' @rdname as_rtf
243
+ # ' @export
244
+ as_rtf.design_fixed_maxcombo_summary <- function (
245
+ x ,
246
+ title = " Fixed Design under MaxCombo Method" ,
247
+ footnote = paste0(
248
+ " Power for MaxCombo test with Fleming-Harrington tests " ,
249
+ substring(x $ Design , 9 ), " ."
250
+ ),
251
+ col_rel_width = NULL ,
252
+ orientation = c(" portrait" , " landscape" ),
253
+ text_font_size = 9 ,
254
+ file ,
255
+ ...
256
+ ) {
257
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
258
+ col_rel_width = col_rel_width , orientation = orientation ,
259
+ text_font_size = text_font_size , file = file , ... )
260
+ }
261
+
262
+ # ' @rdname as_rtf
263
+ # ' @export
264
+ as_rtf.design_fixed_milestone_summary <- function (
265
+ x ,
266
+ title = " Fixed Design under Milestone Method" ,
267
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
268
+ col_rel_width = NULL ,
269
+ orientation = c(" portrait" , " landscape" ),
270
+ text_font_size = 9 ,
271
+ file ,
272
+ ...
273
+ ) {
274
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
275
+ col_rel_width = col_rel_width , orientation = orientation ,
276
+ text_font_size = text_font_size , file = file , ... )
277
+ }
278
+
279
+ # ' @rdname as_rtf
280
+ # ' @export
281
+ as_rtf.design_fixed_rmst_summary <- function (
282
+ x ,
283
+ title = " Fixed Design under Restricted Mean Survival Time Method" ,
284
+ footnote = paste(" Power for" , x $ Design , " computed with method of Yung and Liu." ),
285
+ col_rel_width = NULL ,
286
+ orientation = c(" portrait" , " landscape" ),
287
+ text_font_size = 9 ,
288
+ file ,
289
+ ...
290
+ ) {
291
+ NextMethod(" as_rtf" , x , title = title , footnote = footnote ,
292
+ col_rel_width = col_rel_width , orientation = orientation ,
293
+ text_font_size = text_font_size , file = file , ... )
294
+ }
295
+
149
296
check_rel_width <- function (width , n_col ) {
150
297
if (! is.null(width ) && n_col != length(width )) stop(
151
298
" The length of 'col_rel_width' (" , length(width ), " ) differs with " ,
0 commit comments