I am trying to escape special character "--" in column of DT table but formatPercentage is not letting this happen , manually passing formatPercentage(c(2,3,5)) is working and i want to make it dynamic. so i am looking for a solution through which column having "--" can be displayed in DT table.
I have tried ifelse but doesn't work , this code is just a part of my function.
df <- mtcars[1:6,1:5]
df$drat <- "--"
df$disp <- "--"
#c <- ifelse(df[length(df)] == "--",2:length(df),2:length(df)+1)
datatable(df, escape = FALSE) %>%
formatPercentage(2:5)requirement is how can we pass a list of vector of column through format percentage which can show "--" in DT table output.