This is my code:
library(tidyverse)
library(reactable)
reactable(
iris,
columns = set_names(x = colnames(iris)) %>%
map(~ {
colDef(
style = function(value) {
ds_color <- ifelse(lag(value) < value , "green", "white")
list(background = ds_color)
}
)
})
)
What I need is to color the background of the cell when the value on the row is greater than the lag value.