I have created a function which is creating a table like below, now i want to change the names of labels (25th percentile.25%,75th percentile.75%,Mean,Median...) from global option.
i was trying to convert it into dataframe then replace but structure is being changing.
df <- structure(list(row_labels = c("TT[summary]: context of table|25th percentile.25%",
"TT[summary]: context of table|Mean", "TT[summary]: context of table|Median",
"TT[summary]: context of table|75th percentile.75%", "TT[summary]: context of table|Max",
"TT[summary]: context of table|Min", "TT[summary]: context of table|valid_nn"
), Total = c(62.5, 913.75, 933, 1745.75, 1749, 40, 4), Col1 = c(62.5,
913.75, 933, 1745.75, 1749, 40, 4), COl2 = c(1736, 1736, 1736,
1736, 1736, 1736, 1)), row.names = c(NA, -7L), class = c("etable",
"data.frame"))
global options in rmarkdown are below
options(percentile25 = "25th Percentil")
options(percentile75 = "75th Percentil")
options(Mean_n = "Meana")
options(Med_n = "Mediana")
options(Min_n = "Minn")
options(Max_n = "Maxx")
is there any way where i can change the labels dynamically if the present in the table df for example if Mean present in df the replace it Mean only with Meana and median with mediana ....and so on