I am trying to format the background color of table cells in an R Shiny app based on the content of the cell. The content is either TRUE or FALSE and was assigned using a boolean function. Is styleEqual() not the right way to format the cells? The following will run, but my cells remain uncolored.
output$myTable <-
DT::renderDataTable({
result<-custom_function()
result<-
datatable(result)%>% formatStyle(
names(result),
backgroundColor = styleEqual(c(TRUE, FALSE), c('green', 'red'))
)
return(res)
})
