Replace column names in kable/R markdown
问题 My data frame has ugly column names, but when displaying the table in my report, I want to their "real" names including special characters '(', new lines, greek letters, repeated names, etc. Is there an easy way of replacing the names in knitr to allow such formatting? Proposed solution What I have tried to do is suppress the printing of the data frame names and use add_header_above for better names and names that span several columns. Some advice I've seen says to use: x <- kable(df) gsub("