scale_col(c(NA, -1, 0, 0.5, 1))
## used in combination with attr_style()
attr_style(color = scale_col(c(NA, -1, 0, 0.5, 1)))
## note that for background-color you need inversed
## quotes to deal with the hyphen in an argument name
attr_style(`background-color` = scale_col(c(NA, -1, 0, 0.5, 1)))
tag_attr(class = c(1, 2),
style = attr_style(`background-color` = scale_col(c(-1,1))))
Run the code above in your browser using DataLab