Bus*_*gun 10 r r-markdown
嗨,我只是想问一下如何将表格中的值四舍五入到小数点后两位。这是我的表格输出代码。
kable(Varimportance$anova, caption= "ANOVA Table")
kable(Varimportance$importance, caption= "Variable Importance")
Run Code Online (Sandbox Code Playgroud)
pat*_*net 12
正如上面 pogibas 评论中所建议的,使用digits参数。默认值为getOption("digits")。
kable(Varimportance$anova, caption= "ANOVA Table", digits=2)
kable(Varimportance$importance, caption= "Variable Importance", digits=2)
Run Code Online (Sandbox Code Playgroud)