3
3
# ' Create RTF file output from \code{\link{as_table}} to summarize
4
4
# ' an object; currently only implemented for \code{\link{gsBinomialExact}}.
5
5
# '
6
- # ' @param x Object to be display on rtf.
6
+ # ' @param x Object to be displayed on rtf.
7
7
# ' @param ... Other parameters that may be specific the object.
8
8
# '
9
- # ' @return NULL .
9
+ # ' @return RTF file for summary table .
10
10
# '
11
11
# ' @seealso \code{vignette("binomialSPRTExample")}
12
12
# '
27
27
# ' as_table() %>%
28
28
# ' as_rtf(
29
29
# ' title = "Power/Type I error and expected sample size for a group sequential design",
30
- # ' rtf_path = tempfile(fileext = ".rtf")
30
+ # ' file = tempfile(fileext = ".rtf")
31
31
# ' )
32
32
# '
33
33
# ' safety_design <- binomialSPRT(p0 = .04, p1 = .1, alpha = .04, beta = .2, minn = 4, maxn = 75)
44
44
# ' theta_label = "Underlying\nAE rate",
45
45
# ' prob_decimals = 3,
46
46
# ' bound_label = c("low rate", "high rate"),
47
- # ' rtf_path = tempfile(fileext = ".rtf")
47
+ # ' file = tempfile(fileext = ".rtf")
48
48
# ' )
49
49
as_rtf <- function (x , ... ) UseMethod(" as_rtf" )
50
50
@@ -60,7 +60,7 @@ as_rtf <- function(x, ...) UseMethod("as_rtf")
60
60
# ' @param en_decimals Number of decimal places for expected number of
61
61
# ' observations when bound is crossed or when trial ends without crossing.
62
62
# ' @param rr_decimals Number of decimal places for response rates.
63
- # ' @param rtf_path Output path for the rtf file.
63
+ # ' @param file Output path for the rtf file.
64
64
# '
65
65
# ' @importFrom r2rtf rtf_title rtf_colheader rtf_body rtf_encode write_rtf
66
66
# '
@@ -76,7 +76,7 @@ as_rtf.gsBinomialExactTable <-
76
76
prob_decimals = 2 ,
77
77
en_decimals = 1 ,
78
78
rr_decimals = 0 ,
79
- rtf_path ,
79
+ file ,
80
80
... ) {
81
81
x [,2 ] <- sprintf(paste0(" %." , prob_decimals ," f" ), unlist(x [,2 ]))
82
82
x [,3 ] <- sprintf(paste0(" %." , prob_decimals ," f" ), unlist(x [,3 ]))
@@ -95,8 +95,8 @@ as_rtf.gsBinomialExactTable <-
95
95
) %> %
96
96
rtf_body() %> %
97
97
rtf_encode() %> %
98
- write_rtf(rtf_path )
98
+ write_rtf(file )
99
99
100
- message(" The RTF output is saved in" , normalizePath(rtf_path ))
100
+ message(" The RTF output is saved in" , normalizePath(file ))
101
101
102
102
}
0 commit comments