Hi all,
Is there a way to color "Emails" column below (Red if "Emails" is greater than "Calls", or else, its yellow). The challenge here is , can we also hide "Calls" column as well.
library(shiny)
library(tidyverse)
library(DT)
x <- tibble(
Unit = c("Sales", "Marketing", "HR"),
Calls = c(100, 150, 120),
Emails = c(200, 220, 230),
Calls_goal = c(1, 0, 0),
Emails_goal = c(0, 1, 1)
)
ui <- fluidPage(
mainPanel(
DT::dataTableOutput("table")
)
)
server <- function(input, output) {
output$table <- DT::renderDataTable({
# Can't use both visible = FALSE and rownames = FALSE
datatable(x,
rownames = TRUE)
})
}
shinyApp(ui = ui, server = server)