我正在尝试使用 and 在 rmarkdown 中创建一个表,kable
并且kableExtra
我想在add_header_above
函数中放入希腊字母。
kable(a, format = "latex", booktabs = T, longtable = T) %>%
kable_styling() %>%
add_header_above(c("n", "$\\alpha$", "Estimates for $\\alpha$" = 4,
"Estimates for $\\beta$" = 4), align = "l", escape = F)
我尝试使用escape = F
like here,但它似乎不适用于希腊字母。
我希望在我的 rmarkdown 文档中使用这种样式的表格,并在列标题中使用希腊字母。kable
有没有办法用甚至kableExtra
用另一种方法来做到这一点?
我的数据:
a <- structure(list(c("5", "", "", "", ""), c(0.1, 0.25, 0.5, 1, 2
), MLE = c(0.0839, 0.2082, 0.4194, 0.8237, 1.6201), MME = c(0.0839,
0.2082, 0.4194, 0.8234, 1.6147), UMLE = c(0.1048, 0.2602, 0.5242,
1.0296, 2.0251), UMME = c(0.1048, 0.2602, 0.5242, 1.0293, 2.0183
), MLE = c(1, 1.0057, 1.0232, 1.0824, 1.2543), MME = c(1, 1.0057,
1.0232, 1.0824, 1.2551), UMLE = c(0.9994, 1.0019, 1.0077, 1.0233,
1.0456), UMME = c(0.9994, 1.0019, 1.0077, 1.0233, 1.0476)), .Names = c("",
"", "MLE", "MME", "UMLE", "UMME", "MLE", "MME", "UMLE", "UMME"
), row.names = c(NA, 5L), class = "data.frame")