Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update egt05 #535

Merged
merged 13 commits into from
Jul 14, 2023
22 changes: 8 additions & 14 deletions R/egt05_qtcat.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ egt05_qtcat_main <- function(adam_db,
visitvar = visitvar,
lbl_avisit = lbl_avisit,
lbl_param = lbl_param,
lbl_cat = "Category",
lbl_headvisit = lbl_avisit
lbl_cat = "Category"
)

build_table(
Expand All @@ -72,7 +71,6 @@ egt05_qtcat_main <- function(adam_db,
#' @param lbl_avisit (`string`) label of the `visitvar` variable.
#' @param lbl_param (`string`) label of the `PARAM` variable.
#' @param lbl_cat (`string`) label of the Category of `summaryvars` variable. Default as `Category`.
#' @param lbl_headvisit (`string`) label of Visits in the header. Default as `Analysis Visit`.
#'
#' @keywords internal
egt05_qtcat_lyt <- function(arm_var,
Expand All @@ -82,8 +80,7 @@ egt05_qtcat_lyt <- function(arm_var,
visitvar,
lbl_avisit,
lbl_param,
lbl_cat,
lbl_headvisit) {
lbl_cat) {
basic_table(show_colcounts = TRUE) %>%
split_cols_by(arm_var) %>%
add_colcounts() %>%
Expand All @@ -93,21 +90,21 @@ egt05_qtcat_lyt <- function(arm_var,
labels_var = "PARAM",
split_fun = drop_split_levels,
label_pos = "hidden",
split_label = paste(lbl_param)
split_label = lbl_param,
page_by = TRUE
) %>%
split_rows_by(
visitvar,
split_fun = drop_split_levels,
label_pos = "hidden"
split_label = lbl_avisit,
label_pos = "topleft"
) %>%
summarize_vars_allow_na(
vars = summaryvars,
var_labels = summaryvars_lbls,
inclNAs = FALSE
) %>%
append_topleft(paste(lbl_param)) %>%
append_topleft(paste0(" ", lbl_headvisit)) %>%
append_topleft(paste0(" ", lbl_cat))
append_topleft(paste0(" ", lbl_cat))
}

#' @describeIn egt05_qtcat Preprocessing
Expand All @@ -118,10 +115,7 @@ egt05_qtcat_lyt <- function(arm_var,
#'
egt05_qtcat_pre <- function(adam_db, ...) {
adam_db$adeg <- adam_db$adeg %>%
filter(
.data$ANL01FL == "Y",
.data$PARAMCD %in% "QT"
) %>%
filter(.data$ANL01FL == "Y") %>%
mutate(
AVISIT = reorder(.data$AVISIT, .data$AVISITN),
AVISIT = with_label(.data$AVISIT, "Analysis Visit")
Expand Down
5 changes: 1 addition & 4 deletions man/egt05_qtcat_lyt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.