【发布时间】:2021-05-29 01:20:43
【问题描述】:
我想在我的数据表中有一个 styleColorBar,其中条的大小基于不同的列。
iris %>%
select(Species, Petal.Length) %>%
group_by(Species) %>%
mutate(avg_petal = mean(Petal.Length)) %>%
datatable() %>%
formatStyle(
'Petal.Length',
background = styleColorBar(iris$Petal.Length, 'steelblue'),
backgroundSize = '100% 90%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'center'
)
如何根据avg_petal 列向Species 列添加彩条?
这可能吗?
【问题讨论】:
标签: r datatables