Rendering math symbols in datatable in R

  Kiến thức lập trình

How can I pass latex symbol code to a datatable in R? I found this post, but I don’t know JS and have no idea how to implement something like this in R.

MWE

library(DT)

df <- data.frame(var1 = c("A", "B"),
                 var2 = c("$\alpha$", "$\beta$"))

df %>%
  datatable(
    rownames = FALSE, escape = TRUE,
    colnames = c("Col1", "Col2"), 
    filter = "top"
  )

LEAVE A COMMENT