在RMarkdown的flexdashboard中使用gauge时,出现以下错误:
退出第15-18行(example_reprex.Rmd) validateCssUnit(sizeInfo$width)错误: CSS单位必须是单元素数字或字符向量调用:... -> need_screenshot -> toHTML -> validateCssUnit执行暂停
Reprex:
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
--- {r setup, include=FALSE}
library(flexdashboard) {r}
gauge(10,
min = 0,
max = 20)会话信息,仅供参考:
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 htmltools_0.5.0 tools_4.0.2 flexdashboard_0.5.2 yaml_2.2.1
[6] rmarkdown_2.3 knitr_1.30 jsonlite_1.7.1 xfun_0.17 digest_0.6.25
[11] rlang_0.4.7 evaluate_0.14 发布于 2021-01-15 03:58:49
更新:实际上,我只需简单地识别第一个参数就可以解决这个问题。在上面的例子中,value = 10可以工作,但10不能。
https://stackoverflow.com/questions/65723413
复制相似问题