I'm trying to change the coloring of the background so the coloring is based on row values1 and values2 instead of column, but I'm not sure about the best way to do this. Does anyone have a good idea for the best way to do this?
library(tidyverse)
library(kableExtra)
df <- tibble(variable = letters[1:6], value1 = c(1:3, NA, 2, NA), value2 = c(3:1, NA, NA, 2))
kableExtra::kbl(df, format = "html", escape = FALSE) %>%
kableExtra::column_spec(2, color = "white",
background = kableExtra::spec_color(df$value1, end = 0.7)) %>%
kableExtra::column_spec(3, color = "white",
background = kableExtra::spec_color(df$value2, end = 0.7))