21
21
# ' @param outdata An `outdata` object created by [format_ae_forestly()].
22
22
# ' @param display_soc_toggle A boolean value to display SOC toggle button.
23
23
# ' @param filter A character value of the filter variable.
24
+ # ' @param filter_label A character value of the label for slider bar.
24
25
# ' @param width A numeric value of width of the table in pixels.
25
26
# ' @param max_page A numeric value of max page number shown in the table.
26
27
# '
44
45
ae_forestly <- function (outdata ,
45
46
display_soc_toggle = TRUE ,
46
47
filter = c(" prop" , " n" ),
48
+ filter_label = NULL ,
47
49
width = 1400 ,
48
50
max_page = NULL ) {
49
51
filter <- match.arg(filter )
50
52
filter_range <- c(0 , 100 )
51
53
54
+ if (is.null(filter_label )) {
55
+ filter_label <- ifelse(filter == " prop" ,
56
+ " Incidence (%) in One or More Treatment Groups" ,
57
+ " Number of AE in One or More Treatment Groups" )
58
+ }
59
+
52
60
# `max_page` controls the maximum page number displayed in the interactive forest table.
53
61
# By default (`NULL`), it will display the counts that round up to the nearest hundred.
54
62
if (is.null(max_page )) {
@@ -102,7 +110,7 @@ ae_forestly <- function(outdata,
102
110
if (filter == " prop" ) {
103
111
filter_subject <- crosstalk :: filter_slider(
104
112
id = " filter_subject" ,
105
- label = " Incidence (%) in One or More Treatment Groups " ,
113
+ label = filter_label ,
106
114
sharedData = tbl ,
107
115
column = ~ hide_prop , # whose values will be used for this slider
108
116
step = 1 , # specifies interval between each select-able value on the slider
@@ -115,13 +123,13 @@ ae_forestly <- function(outdata,
115
123
if (filter == " n" ) {
116
124
filter_subject <- crosstalk :: filter_slider(
117
125
id = " filter_subject" ,
118
- label = " Number of AE in One or More Treatment Groups " ,
126
+ label = filter_label ,
119
127
sharedData = tbl ,
120
128
column = ~ hide_n ,
121
129
step = 1 ,
122
130
width = 250 ,
123
- min = filter_range [1 ],
124
- max = filter_range [2 ]
131
+ min = filter_range [1 ], # the leftmost value of the slider
132
+ max = filter_range [2 ] # the rightmost value of the slider
125
133
)
126
134
}
127
135
0 commit comments