This function modifies a data frame by updating the stat_0 column. If any values in
stat_0 are missing (NA), they are replaced by the values from the n column.
After the replacement, the n column is removed from the data frame.
Usage
customize_table_body(data)
Value
A modified data frame with:
Updated stat_0 values (replaced with n values where NA is found).
The n column removed after integration.
Arguments
data
A data frame that must contain at least two columns:
stat_0: A column whose missing (NA) values are to be replaced.
n: A column providing replacement values for stat_0 when its values are missing.
Details
The function uses dplyr::case_when to conditionally update the stat_0 column.
After the replacement process, the n column is dropped using dplyr::select(-n).
This function is particularly useful for cleaning and preparing table data.