I want to display a table in my markdown document and set the column names as latex mathematical formulas such as $ \ dot (m) _1 $.
I tried this:
knitr::kable(my.df[, c("Time", "MassFlowRate")], row.names = FALSE, col.names = c("Time", "$\dot{m}_1$"))
But that will not work.
In the end, I am not creating a PDF, but a Word document. Therefore, direct coding of the Latex table is not an option.
You need to output \to R-code, so it \dotsshould be \\dots:
\
\dots
\\dots
```{r} my.df <- data.frame(Time=rnorm(10), MassFlowRate = rnorm(10)) knitr::kable(my.df[, c("Time", "MassFlowRate")], row.names = FALSE, col.names = c("Time", "$\\dot{m}_1$")) ```
To get the current answer, you need to add , escape = FALSEto kable().
, escape = FALSE
kable()
, tibble data.frame. , LaTeX . col.names.
tibble
data.frame
col.names
'''{r} library(tibble) my_df <- tibble(Time=rnorm(10), '$\\dot{m}_1$' = rnorm(10)) knitr::kable(my_df, escape = FALSE) '''
Source: https://habr.com/ru/post/1670304/More articles:django rest adds data to serializer when saving - djangoHide text from a TextBox without using PasswordBox - wpfКак использовать /dist файлы папок, созданные командой angular -cli ng build для создания приложения, которое можно запустить самостоятельно? - angular4 gradient borders in CSS - htmlGit + merge conflicts with Windows + Visual Studio caused by line ending Problems between branches - gitМетод возврата логического значения, который определяет, являются ли 2 массива одинаковыми в значениях - javaUse ObjectId.GenerateNewId () or leave MongoDB to create it? - c #Порядок столбцов `.SD` в аргументе j отличается при использовании` get() ` - rUnusual behavior in a Java application deployed in tomcat - javaWhy are Python lists implemented as dynamic arrays instead of ring buffers? - pythonAll Articles