Skip to content

Commit

Permalink
Fix last note
Browse files Browse the repository at this point in the history
  • Loading branch information
Melkiades committed Nov 7, 2024
1 parent 343845b commit 4f3b5fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions R/summarize_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ a_change_from_baseline <- function(df,
custom_stat_functions <- default_and_custom_stats_list$custom_stats

# Adding automatically extra parameters to the statistic function (see ?rtables::additional_fun_params)
extra_afun_params <- names(list(...)$.additional_fun_parameters)
extra_afun_params <- retrieve_extra_afun_params(
names(list(...)$.additional_fun_parameters)
)
x_stats <- .apply_stat_functions(
default_stat_fnc = s_change_from_baseline,
custom_stat_fnc_list = custom_stat_functions,
args_list = c(
df = list(df),
retrieve_extra_afun_params(extra_afun_params),
extra_afun_params,
list(...)
)
)
Expand All @@ -91,7 +93,12 @@ a_change_from_baseline <- function(df,
.indent_mods <- get_indents_from_stats(.stats, .indent_mods)

# Auto format handling
.formats <- apply_auto_formatting(.formats, x_stats, .df_row, .var)
.formats <- apply_auto_formatting(
.formats,
x_stats,
extra_afun_params$.df_row,
extra_afun_params$.var
)

in_rows(
.list = x_stats[.stats],
Expand Down
2 changes: 1 addition & 1 deletion R/utils_rtables.R
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ get_additional_afun_params <- function(add_alt_df = FALSE) {
out_list <- c(
out_list,
.alt_df_row = data.frame(),
.alt_df = data.frame(),
.alt_df = data.frame()
)
}

Expand Down

0 comments on commit 4f3b5fd

Please sign in to comment.