How can I have LaTeX symbols like alpha or delta in column names of html output with gt
package.
library(gt)
# Create a data frame
data <- data.frame(
x = c(1, 2, 3),
y = c(4, 5, 6)
)
# Set the column names as LaTeX formulas
colnames(data) <- c("$\\alpha$", "$\\beta$")
# Create a gt table
gt(data)
If you do not mind using unicode, this works but I appreciate it does not use LaTeX equation mode.
library(gt)
# Create a data frame
data <- data.frame(
x = c(1, 2, 3),
y = c(4, 5, 6)
)
# Set the column names with unicode
colnames(data) <- c("\u03B1", "\u03B2")
# Create a gt table
gt(data)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With