I would like to have some fancy equations within a nicely formatted table. Is it possible to use flextable to achieve this?
library(flextable)
df <- data.frame(FancyMath= c("$A^{-1}$", "$A = pi~r^2$"))
flextable(df)
The $ $ notation is not creating Math-style writing as I would expect. Thanks!
The answer depends on how your question is understood:
$math$
?No, it's not possible.
Yes, what you are looking for is:
install.packages("equatags")
library(flextable)
df <- data.frame(FancyMath = c("A^{-1}", "A = pi~r^2")) # Note `$` signs are omitted
flextable(df) |>
compose(j = "FancyMath", value = as_paragraph(as_equation(FancyMath)))