Skip to content

Commit a9b2574

Browse files
author
ginnaram
committed
Ae Criterion updated
1 parent c9ffc50 commit a9b2574

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

R/ae_forestly.R

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#' @param filter A character value of the filter variable.
2424
#' @param filter_label A character value of the label for slider bar.
2525
#' @param filter_range A numeric vector of length 2 for the range of the slider bar.
26+
#' @param ae_label A character value of the label for criteria.
2627
#' If NULL (default), the range is automatically calculated from the data.
2728
#' If only one value is provided, it will be used as the maximum and minimum will be 0.
2829
#' @param width A numeric value of width of the table in pixels.
@@ -49,6 +50,7 @@ ae_forestly <- function(outdata,
4950
filter = c("prop", "n"),
5051
filter_label = NULL,
5152
filter_range = NULL,
53+
ae_label = NULL,
5254
width = 1400,
5355
max_page = NULL) {
5456
filter <- match.arg(filter)
@@ -89,8 +91,8 @@ ae_forestly <- function(outdata,
8991

9092
if (is.null(filter_label)) {
9193
filter_label <- ifelse(filter == "prop",
92-
"Incidence (%) in One or More Treatment Groups",
93-
"Number of AE in One or More Treatment Groups"
94+
"Incidence (%) in One or More Treatment Groups",
95+
"Number of AE in One or More Treatment Groups"
9496
)
9597
}
9698

@@ -104,8 +106,8 @@ ae_forestly <- function(outdata,
104106

105107
parameters <- unlist(strsplit(outdata$parameter, ";"))
106108
par_label <- vapply(parameters,
107-
function(x) metalite::collect_adam_mapping(outdata$meta, x)$label,
108-
FUN.VALUE = character(1)
109+
function(x) metalite::collect_adam_mapping(outdata$meta, x)$label,
110+
FUN.VALUE = character(1)
109111
)
110112

111113
for (par in parameters[(!(parameters %in% unique(outdata$parameter_order)))]) {
@@ -136,9 +138,14 @@ ae_forestly <- function(outdata,
136138
default_param <- as.character(unique(outdata$tbl$parameter)[1])
137139

138140
random_id <- paste0("filter_ae_", uuid::UUIDgenerate(), "|", default_param)
141+
142+
if (is.null(ae_label)) {
143+
ae_label <- "AE Criteria"
144+
}
145+
139146
filter_ae <- crosstalk::filter_select(
140147
id = random_id,
141-
label = "AE Criteria",
148+
label = ae_label,
142149
sharedData = tbl,
143150
group = ~parameter,
144151
multiple = FALSE
@@ -192,9 +199,9 @@ ae_forestly <- function(outdata,
192199
t_details <- subset(
193200
outdata$ae_listing,
194201
((toupper(outdata$ae_listing$Adverse_Event) %in% toupper(t_row)) &
195-
(outdata$ae_listing$param == t_param)) |
202+
(outdata$ae_listing$param == t_param)) |
196203
((toupper(outdata$ae_listing$SOC_Name) %in% toupper(t_row)) &
197-
(outdata$ae_listing$param == t_param))
204+
(outdata$ae_listing$param == t_param))
198205
)
199206

200207
# Exclude 'param' column from t_details

man/ae_forestly.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)