【发布时间】:2019-10-25 07:58:52
【问题描述】:
有没有办法在 kable 函数中格式化数字而不将源对象中的数据转换为格式化字符串?
library(dplyr)
library(knitr)
library(kableExtra)
test.data <- data.frame(merchant = c("merchant 1",
"merchant 2",
"merchant 3",
"merchant 4",
"merchant 5"),
amount = c(3158.01,
2341.67,
1873.24,
1578.15,
1273.19))
test.data %>%
kable() %>%
kable_styling(full_width = FALSE)
我需要将什么传递给kable 函数以将数字设置为货币样式?
【问题讨论】: