Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/abnormal.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ count_abnormal <- function(lyt,
.stat_names = NULL,
.formats = list(fraction = format_fraction),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand All @@ -243,6 +244,7 @@ count_abnormal <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = "hidden",
table_names = table_names
table_names = table_names,
format = format
)
}
6 changes: 4 additions & 2 deletions R/abnormal_by_baseline.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ count_abnormal_by_baseline <- function(lyt,
.stat_names = NULL,
.formats = list(fraction = format_fraction),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_character(abnormal, len = length(table_names), names = "named")
checkmate::assert_string(var)

Expand Down Expand Up @@ -266,7 +267,8 @@ count_abnormal_by_baseline <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = "visible",
table_names = table_names[i]
table_names = table_names[i],
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/abnormal_by_marked.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ count_abnormal_by_marked <- function(lyt,
.stat_names = NULL,
.formats = list(count_fraction = format_count_fraction),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_string(var)

# Process standard extra arguments
Expand All @@ -299,6 +300,7 @@ count_abnormal_by_marked <- function(lyt,
na_str = na_str,
nested = nested,
extra_args = extra_args,
show_labels = "hidden"
show_labels = "hidden",
format = format
)
}
6 changes: 4 additions & 2 deletions R/abnormal_by_worst_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ count_abnormal_by_worst_grade <- function(lyt,
.stat_names = NULL,
.formats = list(count_fraction = format_count_fraction),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand All @@ -233,7 +234,8 @@ count_abnormal_by_worst_grade <- function(lyt,
na_str = na_str,
nested = nested,
extra_args = extra_args,
show_labels = "hidden"
show_labels = "hidden",
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/abnormal_lab_worsen_by_baseline.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ count_abnormal_lab_worsen_by_baseline <- function(lyt,
.stat_names = NULL,
.formats = list(fraction = format_fraction),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_string(var)

# Deprecated argument warning
Expand Down Expand Up @@ -231,7 +232,8 @@ count_abnormal_lab_worsen_by_baseline <- function(lyt,
na_str = na_str,
nested = nested,
extra_args = extra_args,
show_labels = "hidden"
show_labels = "hidden",
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/analyze_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@ analyze_vars <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Depending on main functions
extra_args <- list(
"na_rm" = na_rm,
Expand Down Expand Up @@ -796,6 +797,7 @@ analyze_vars <- function(lyt,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names,
section_div = section_div
section_div = section_div,
format = format
)
}
6 changes: 4 additions & 2 deletions R/count_cumulative.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ count_cumulative <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = format) {
# Depending on main functions
extra_args <- list(
"na_rm" = na_rm,
Expand Down Expand Up @@ -290,6 +291,7 @@ count_cumulative <- function(lyt,
var_labels = var_labels,
show_labels = show_labels,
nested = nested,
extra_args = extra_args
extra_args = extra_args,
format = format
)
}
6 changes: 4 additions & 2 deletions R/count_missed_doses.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ count_missed_doses <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Depending on main functions
extra_args <- list(
"na_rm" = na_rm,
Expand Down Expand Up @@ -226,6 +227,7 @@ count_missed_doses <- function(lyt,
var_labels = var_labels,
show_labels = show_labels,
nested = nested,
extra_args = extra_args
extra_args = extra_args,
format = format
)
}
6 changes: 4 additions & 2 deletions R/count_occurrences.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ count_occurrences <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_flag(riskdiff)
afun <- if (isFALSE(riskdiff)) a_count_occurrences else afun_riskdiff

Expand Down Expand Up @@ -285,7 +286,8 @@ count_occurrences <- function(lyt,
extra_args = extra_args,
var_labels = var_labels,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/count_occurrences_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ count_occurrences_by_grade <- function(lyt,
.stat_names = NULL,
.formats = list(count_fraction = format_count_fraction_fixed_dp),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_flag(riskdiff)
afun <- if (isFALSE(riskdiff)) a_count_occurrences_by_grade else afun_riskdiff

Expand Down Expand Up @@ -409,7 +410,8 @@ count_occurrences_by_grade <- function(lyt,
extra_args = extra_args,
var_labels = var_labels,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/count_patients_with_event.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ count_patients_with_event <- function(lyt,
.stat_names = NULL,
.formats = list(count_fraction = format_count_fraction_fixed_dp),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
checkmate::assert_flag(riskdiff)
afun <- if (isFALSE(riskdiff)) a_count_patients_with_event else afun_riskdiff

Expand Down Expand Up @@ -242,6 +243,7 @@ count_patients_with_event <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}
6 changes: 4 additions & 2 deletions R/count_patients_with_flags.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ count_patients_with_flags <- function(lyt,
.stat_names = NULL,
.formats = list(count_fraction = format_count_fraction_fixed_dp),
.indent_mods = NULL,
.labels = NULL) {
.labels = NULL,
format = NULL) {
checkmate::assert_flag(riskdiff)
afun <- if (isFALSE(riskdiff)) a_count_patients_with_flags else afun_riskdiff

Expand Down Expand Up @@ -257,6 +258,7 @@ count_patients_with_flags <- function(lyt,
extra_args = extra_args,
var_labels = var_labels,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}
6 changes: 4 additions & 2 deletions R/count_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ count_values <- function(lyt,
.stat_names = NULL,
.formats = c(count_fraction = "xx (xx.xx%)", count = "xx"),
.labels = c(count_fraction = paste(values, collapse = ", ")),
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand All @@ -214,6 +215,7 @@ count_values <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = ifelse(length(vars) > 1, "visible", "hidden"),
table_names = table_names
table_names = table_names,
format = format
)
}
6 changes: 4 additions & 2 deletions R/estimate_multinomial_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ estimate_multinomial_response <- function(lyt,
.stat_names = NULL,
.formats = list(prop_ci = "(xx.xx, xx.xx)"),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand All @@ -232,6 +233,7 @@ estimate_multinomial_response <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}
6 changes: 4 additions & 2 deletions R/estimate_proportion.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ estimate_proportion <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand Down Expand Up @@ -277,7 +278,8 @@ estimate_proportion <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}

Expand Down
3 changes: 3 additions & 0 deletions R/formatting_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@ count_decimalplaces <- function(dec) {
#'
#' @keywords internal
apply_auto_formatting <- function(.formats, x_stats, .df_row, .var) {
if (inherits(.formats, "no_auto_fmt")){
return(NULL)
}
is_auto_fmt <- vapply(.formats, function(ii) is.character(ii) && ii == "auto", logical(1))
if (any(is_auto_fmt)) {
auto_stats <- x_stats[is_auto_fmt]
Expand Down
6 changes: 4 additions & 2 deletions R/incidence_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ estimate_incidence_rate <- function(lyt,
.stat_names = NULL,
.formats = list(rate = "xx.xx", rate_ci = "(xx.xx, xx.xx)"),
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand Down Expand Up @@ -264,7 +265,8 @@ estimate_incidence_rate <- function(lyt,
nested = nested,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
} else {
summarize_row_groups(
Expand Down
6 changes: 4 additions & 2 deletions R/odds_ratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ estimate_odds_ratio <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL) {
.indent_mods = NULL,
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand Down Expand Up @@ -292,7 +293,8 @@ estimate_odds_ratio <- function(lyt,
extra_args = extra_args,
var_labels = var_labels,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/prop_diff.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ estimate_proportion_diff <- function(lyt,
.stat_names = NULL,
.formats = c(diff = "xx.x", diff_ci = "(xx.x, xx.x)"),
.labels = NULL,
.indent_mods = c(diff = 0L, diff_ci = 1L)) {
.indent_mods = c(diff = 0L, diff_ci = 1L),
format = NULL) {
# Depending on main functions
extra_args <- list(
"na_rm" = na_rm,
Expand Down Expand Up @@ -320,7 +321,8 @@ estimate_proportion_diff <- function(lyt,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names,
section_div = section_div
section_div = section_div,
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/prop_diff_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ test_proportion_diff <- function(lyt,
.stat_names = NULL,
.formats = c(pval = "x.xxxx | (<0.0001)"),
.labels = NULL,
.indent_mods = c(pval = 1L)) {
.indent_mods = c(pval = 1L),
format = NULL) {
# Depending on main functions
extra_args <- list(
"na_rm" = na_rm,
Expand Down Expand Up @@ -271,7 +272,8 @@ test_proportion_diff <- function(lyt,
extra_args = extra_args,
show_labels = show_labels,
table_names = table_names,
section_div = section_div
section_div = section_div,
format = format
)
}

Expand Down
6 changes: 4 additions & 2 deletions R/summarize_ancova.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ summarize_ancova <- function(lyt,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = list("lsmean_diff_ci" = 1L, "pval" = 1L)) {
.indent_mods = list("lsmean_diff_ci" = 1L, "pval" = 1L),
format = NULL) {
# Process standard extra arguments
extra_args <- list(".stats" = .stats)
if (!is.null(.stat_names)) extra_args[[".stat_names"]] <- .stat_names
Expand Down Expand Up @@ -351,6 +352,7 @@ summarize_ancova <- function(lyt,
extra_args = extra_args,
var_labels = var_labels,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
format = format
)
}
Loading