This function modifies a table by updating the "stat_" columns with corresponding
"add_n_stat_" columns if they exist. If "stat_" columns contain missing values
(NA), the function replaces them with the respective "add_n_stat_" column values.
Extra "add_n_stat_*" columns are removed after processing.
modify_table_body_func(data)A modified data frame where:
stat_* columns are updated to replace NA values with the corresponding values
from add_n_stat_*.
add_n_stat_* columns are removed after processing.
If no add_n_stat_* columns exist, these columns are simply removed.
The function identifies columns starting with "add_n_stat_" and attempts to use them to fill missing values in columns matching the pattern "^stat_\d+$".
If all required "add_n_stat_*" columns exist in data, they are utilized for this
replacement; otherwise, the add_n_stat_* columns are removed without modifications
to the stat_* columns.