# Example data frame
df <- data.frame(
category = c("A", "B", "C"),
value1 = c(10, 20, 30),
value2 = c(5, 15, 25)
)
df_with_total <- add_row_total(df)
df_with_total_top <- add_row_total(df, position = "top")
Run the code above in your browser using DataLab