# Example data
data <- data.frame(
n = c(1, 2, 3),
stat_1 = c(NA, 5, 6),
stat_2 = c(7, NA, 9),
add_n_stat_1 = c(10, 11, 12),
add_n_stat_2 = c(13, 14, 15)
)
# Apply the function
modified_data <- modify_table_body_func(data)
print(modified_data)
Run the code above in your browser using DataLab