【发布时间】:2019-06-16 06:21:39
【问题描述】:
我是 rhandsontable 包的新手,我正在尝试根据另一个单元格中的值突出显示一个单元格。我想在 mpg==21 时突出显示 mtcars 数据集中“齿轮”列中的值。我没有任何线索如何做。感谢 rhandsontable 中的一些帮助
rhandsontable(mtcars, readOnly = TRUE, width = 750, height =
300)%>%hot_cols(renderer = "
function (instance, td, row, col , prop, value,
cellProperties) {
Handsontable.renderers.NumericRenderer.apply(this, arguments);
var col_value = instance.getData()[XXXXXXXXXXX][XXXXXXXXX]
if (col_value ==21) {
td.style.background = 'pink';
}else if (col_value !=21) {
td.style.background = 'green';
}
}")
我不知道如何编写上面的代码来实现我的结果
【问题讨论】:
标签: rhandsontable