我在 R Markdown 文档中创建了一个 table,我想使用 kable
包中的
kable_styling
和 kableExtra
以 html 格式打印。一列包含的单元格应仅显示一个星号“*”。
在 html 中,这些单元格被描述为点/项目符号?!如何更改我的输出,使单个星号仅打印为星号(如包含“**”或“***”的单元格)?
示例代码:
```{r example}
df <- data.frame(type = c("a", "b", "c", "d"),
number = runif(4),
asterisks = c("*", "*", "**", "***"))
df %>%
kable(caption = "Single asterisk looks like point...") %>%
kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, position = "left")
```
html 输出:
非常感谢任何帮助。谢谢!